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
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Metadata
Release files for ts-viz 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ts_viz-0.2.0.tar.gz | 8.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ts_viz-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.2 kB
Release files / ts_viz-0.2.0.tar.gz
| Download URL | ts_viz-0.2.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5296e5daac6548da4f32f2adfa96147fce853911e63c3ef8421d5c541854ea39
|
|
BLAKE2b-256 checksum How to use checksums |
dd74e0c2abcce49e1ae206778b950f83c79b41ab9004ed4e3f3690c7b7f5b4e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.0
|
Release files / ts_viz-0.2.0-py3-none-any.whl
| Download URL | ts_viz-0.2.0-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4132548abbe26f899569f16b680d0b63b7a3d1527ed4a77bbcb2b68615d5f9eb
|
|
BLAKE2b-256 checksum How to use checksums |
985020618d2881c40ab6d388578d61c1cac8a0916d7b2835c27e70f541988173
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.0
|