Skip to main content

Visualization utilities for time series analysis including outlier detection, trendlines, and correlation analysis.

Project description

TS-Viz: Time Series Visualization Library

ts-viz is a Python package for visualizing and analyzing time series data, with built-in tools for:

  • Outlier detection
  • Histograms with statistical markers
  • Time series plots with rolling averages
  • Feature correlation scatter plots with trendlines

Built using pandas, matplotlib, and seaborn, this library simplifies exploratory data analysis (EDA) for time-series-heavy applications.

🧩 Features

  • ✅ Plot histograms with mean and ±3 standard deviation lines
  • ✅ Detect and visualize outliers for a given feature by month
  • ✅ Plot time series trends with outlier and date-range highlights
  • ✅ Explore feature-to-feature correlation with outlier and trend detection

🚀 Usage Examples

1. 📊 Histogram with Statistical Markers

from ts_viz import plot_histogram_with_markers
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
plot_histogram_with_markers(df, 'your_column_name', ax)
plt.show()

2. 🧯 Outlier Detection (Optional Month-Year Filter)

from ts_viz import identify_and_plot_outliers

fig, ax = plt.subplots()
results = identify_and_plot_outliers(
    data=df,
    feature_name='your_column',
    date_column='timestamp',
    month_year='2023-11',  # optional, can be None
    ax=ax
)
plt.show()

# Access results:
print(results['total_outliers'], results['percent_outliers'])

3. 📈 Line Plot Over Time

from ts_viz import plot_feature_line_graph

plot = plot_feature_line_graph(
    data=df,
    feature_name='temperature',
    date_column='timestamp',
    highlight_month_year='2023-11'
)
plot.show()

4. 📅 Line Plot for Custom Date Ranges with Highlights

from ts_viz import plot_feature_line_graph_date_range

plot = plot_feature_line_graph_date_range(
    data=df,
    feature_name='pressure',
    date_column='timestamp',
    start_date='2023-01-01',
    end_date='2023-06-30',
    highlight_ranges=[
        ('2023-02-01', '2023-02-10', 'Batch A'),
        ('2023-05-15', '2023-05-20', 'Batch B')
    ]
)
plot.show()

5. 🔗 Correlation Between Two Features

from ts_viz import plot_feature_correlation

plot = plot_feature_correlation(
    data=df,
    feature_x='temperature',
    feature_y='pressure',
    date_column='timestamp',
    highlight_month_year='2023-03'
)
plot.show()

📦 Installation

pip3 install ts-viz

🧰 Requirements

  • Python >= 3.11
  • pandas >= 2.1.0
  • numpy >= 1.26.0
  • matplotlib
  • seaborn
  • datetime

📄 License

This project is licensed under the MIT License – see the LICENSE file for details.

👤 Author

Created by Chitra Kumar Sai Chenuri Venkata. Contributions welcome!

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ts_viz-0.1.3.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ts_viz-0.1.3-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file ts_viz-0.1.3.tar.gz.

File metadata

  • Download URL: ts_viz-0.1.3.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for ts_viz-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4750ea9e2a32a756b3c13d1c7622511784b31eaa697cf0bb11e1472d539e2ab7
MD5 7abedf6b7eeea5b65f07a13df48772be
BLAKE2b-256 90df138d905f945fe566b79a73b9b1db7b45ece3653499f36295cf0b116e43dd

See more details on using hashes here.

File details

Details for the file ts_viz-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ts_viz-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for ts_viz-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e40dee6d5fac22f976f4e2bde7540210ffb29435ebda5f642d57f6f8e1068a4f
MD5 574e7463f9a87a83dd6817f905ca2c3a
BLAKE2b-256 6099786e3663586de7558109f2ead57233b2a071a7ccb9f3bd74e7a57ca45a1b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page