import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.close('all')
ts=pd.Series(np.random.randn(1000),index=pd.date_range('1/1/2020',periods=1000))
ts=ts.cumsum()
ts.plot()
df=pd.DataFrame(np.random.randn(1000,4),index=ts.index,columns=['A','B','C','D'])
df=df.cumsum()
plt.figure()
df.plot()
plt.legend(loc='best')
df.to_hdf('foo.h5', 'df')
Error message:
ImportError: Missing optional dependency 'tables'. Use pip or conda to install tables.
That is the cmd command:
C:\Users\rehim>pip install --user tables
The result:
Requirement already satisfied: tables in c:\users\rehim\appdata\roaming\python\python38\site-packages (3.6.1) Requirement already satisfied: numpy>=1.9.3 in c:\users\rehim\appdata\local\programs\python\python38\lib\site-packages (from tables) (1.19.2) Requirement already satisfied: numexpr>=2.6.2 in c:\users\rehim\appdata\roaming\python\python38\site-packages (from tables) (2.7.1)