Skip to main content

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 / Object 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


Download files

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

Source Distribution

direl_ts_tool_kit-0.4.3.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

direl_ts_tool_kit-0.4.3-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file direl_ts_tool_kit-0.4.3.tar.gz.

File metadata

  • Download URL: direl_ts_tool_kit-0.4.3.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

Hashes for direl_ts_tool_kit-0.4.3.tar.gz
Algorithm Hash digest
SHA256 83e90007f89867fa3645ba9efe2a80971ae90740e15369e2554189070d19074d
MD5 78c720ccbdcb51a5390e1cb569be0151
BLAKE2b-256 191d633129a1a23e98b64a4e5db025ca4d43d6222b410825b2c31176c8916597

See more details on using hashes here.

File details

Details for the file direl_ts_tool_kit-0.4.3-py3-none-any.whl.

File metadata

File hashes

Hashes for direl_ts_tool_kit-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 23d80623a424b4471154336e401ae844db275aca99e7c96eb793fc44b5050f05
MD5 de5a96580dc96c3f9257647ef52589a8
BLAKE2b-256 ef65b767f52b0ba5964ac7b146590a36f24ce3f53863a0649f3f73fb1f7eee52

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