A toolbox for time series analysis and visualization.
Project description
direl-ts-tool-kit: A Toolbox for Time Series Analysis and Visualization
A lightweight Python library developed to streamline common tasks in time series processing, including data preparation, visualization with a consistent aesthetic style, and handling irregular indices.
Key features and functions
The library provides the following key functionalities, primarily centered around data preparation and plotting.
Data preparation and index management
| Function | Description |
|---|---|
| parse_datetime_index(df_raw, date_column, format) | Converts a specified column (defaults to "date") from a raw DataFrame into a proper DatetimeIndex. It handles specific format strings to ensure correct date parsing, and returns the cleaned, indexed DataFrame. |
| generate_dates(df_ts, freq) | Creates a complete and regular pd.DatetimeIndex spanning from the first to the last date found in the input DataFrame's index. This is primarily used to define a target index for reindexing operations. |
| reindex_and_aggregate(df_ts, column_name) | Aligns an irregularly indexed time series DataFrame to a regular frequency. It aggregates data within each time step (e.g., calculates the mean) and fills any resulting time gaps with NaN values. |
Visualization and styling
| Function | Description |
|---|---|
| plot_time_series(df_ts, variable, ...) | Generates a customizable time series plot using Matplotlib. It automatically handles x-axis localization based on time_unit (Year, Month, etc.), applies a consistent aesthetic style, and supports automatic formatting of the Y-axis label. |
| paper_colors (Dictionary) | A global dictionary containing a predefined palette of high-contrast, professional color codes (hex values). These color keys (e.g., "BLUE_LINES", "ORANGE_BARS") are used to ensure visual consistency across all generated plots. |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file direl_ts_tool_kit-0.4.4.tar.gz.
File metadata
- Download URL: direl_ts_tool_kit-0.4.4.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acc9a85f13f50df70619ae9c84d76f1b7711150339127d9a736cea5e1158925c
|
|
| MD5 |
17e8bb0bbce163cfb9087d1b44670686
|
|
| BLAKE2b-256 |
686c2b693d3f749d2bc0a38acb561cf47b525905f3277dcbcd8607af255ff440
|
File details
Details for the file direl_ts_tool_kit-0.4.4-py3-none-any.whl.
File metadata
- Download URL: direl_ts_tool_kit-0.4.4-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87b01b0c62a8bba80944d3f3e103bafc8fc4588a311288583933c52c13a91d10
|
|
| MD5 |
939e21cfa00fc64a053c22dcd2e83389
|
|
| BLAKE2b-256 |
39c546dd7b9cc48366e398c96b12c5b7948a2c126adbc9a929795d19e7adde1d
|