Python package for statistical data animations
Project description
Pynimate
Python package for statistical data animations.
How to use
pynimate expects pandas dataframe formatted in this manner:
Where the time column is set to index.
time, col1, col2, col3
2012 1 2 1
2013 1 1 2
2014 2 1.5 3
2015 2.5 2 3.5
Bar Chart Example
from matplotlib import pyplot as plt
import pandas as pd
import pynimate as nim
df = pd.DataFrame(
{
"time": ["1960-01-01", "1961-01-01", "1962-01-01"],
"Afghanistan": [1, 2, 3],
"Angola": [2, 3, 4],
"Albania": [1, 2, 5],
"USA": [5, 3, 4],
"Argentina": [1, 4, 5],
}
).set_index("time")
bar = nim.BarBasic(df, "%Y-%m-%d", "2d")
bar.set_time(callback=lambda i, data, time, rank: time[i].strftime("%b, %Y"))
bar.animate()
plt.show()
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
pynimate-1.0.1.tar.gz
(11.8 kB
view hashes)
Built Distribution
pynimate-1.0.1-py3-none-any.whl
(12.2 kB
view hashes)