Linecharts to plot the seasonal behaviour of data series throughout a year comparing the same month in different years.
Project description
Estacionalidad!
Getting started
pip install estacionalidad
Example using INDEC (Argentina) foreign trade price and quantities index
from estacionalidad.Wrangling import DataFrameAdapter, read_series_indices_indec
from estacionalidad.Plot import SeasonalityChart, AxesConfig
from matplotlib import pyplot as plt
df = read_series_indices_indec()
axes_config = AxesConfig()
axes_config.ylabel = "Índice 2004 = 100"
axes_config.nticks = 20
x = (
SeasonalityChart(
DataFrameAdapter(df, 'quarterly', 'Y', 'M')
.Map("p_x", "Índice de precios de las exportaciones")
.Map("q_x", "Índice de cantidades de las exportaciones"))
.set_year("2014", "2024")
.map_color("p_x", "#FFE294", "#8B0000")
.map_color("q_x", "#ECB210", "#8B0000")
.set_axconfig(axes_config))
m = (
SeasonalityChart(
DataFrameAdapter(df, 'quarterly', 'Y', 'M')
.Map("p_m", "Índice de precios de las importaciones")
.Map("q_m", "Índice de cantidades de las importaciones"))
.set_year("2014", "2024")
.map_color("p_m", "#CBADE0", "#8B0000")
.map_color("q_m", "#A285A5", "#8B0000")
.set_axconfig(axes_config))
iti = (
SeasonalityChart(
DataFrameAdapter(df, 'quarterly', 'Y', 'M')
.Map("ITI", "Índice de términos del intercambio")
)
.set_year("2014", "2024")
.map_color("ITI", "#CBADE0", "#8B0000")
.set_axconfig(axes_config))
axes_config.linewidth = 2
axes_config.legend.loc = "lower center"
for plot in (x, m, iti):
plot.render()
print(x.table.table_df)
plt.show()
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
estacionalidad-0.1.9.tar.gz
(28.0 kB
view details)
Built Distribution
File details
Details for the file estacionalidad-0.1.9.tar.gz
.
File metadata
- Download URL: estacionalidad-0.1.9.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3966e0f0ca5c8daf0c13a9a48bba9907deb26da21080514b84fe7ebf331d6b7e |
|
MD5 | dfe1a16b37ce48598a87edfb7d21dc37 |
|
BLAKE2b-256 | cceddf81e68d958e4cd5d7aef76985556e936b26d8393c6a3e70e53a29d3c467 |
File details
Details for the file estacionalidad-0.1.9-py3-none-any.whl
.
File metadata
- Download URL: estacionalidad-0.1.9-py3-none-any.whl
- Upload date:
- Size: 28.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5457c86ad2a30c27db01c7e74ff727f43783000a0ee5313cd6331165de4db0ed |
|
MD5 | e787ed220b5f0f8decd501c127221693 |
|
BLAKE2b-256 | 8589cf0fb697956b6dc183de58142515761c8c0d43b98e74004cadf3ed3aef9d |