Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 16658
Kernel: Python 2 (SageMath)
import pandas as pd import numpy as np import matplotlib.pyplot as plt
s = pd.Series([1,3,5,np.nan,7,9]) s
0 1.0 1 3.0 2 5.0 3 NaN 4 7.0 5 9.0 dtype: float64
dates = pd.date_range('20130101', periods=6) dates
DatetimeIndex(['2013-01-01', '2013-01-02', '2013-01-03', '2013-01-04', '2013-01-05', '2013-01-06'], dtype='datetime64[ns]', freq='D')
df = pd.DataFrame(np.random.randn(6,4), index=dates, columns=list('ABCD')) df
A B C D
2013-01-01 -0.029417 0.882268 -0.978273 -0.663323
2013-01-02 0.254186 0.387478 0.703371 -0.021914
2013-01-03 0.513787 -1.004384 0.706066 -0.705586
2013-01-04 -0.857732 0.820974 -1.391208 -0.506392
2013-01-05 0.724756 -0.895884 -1.231815 -0.993212
2013-01-06 2.227114 1.765319 0.215122 -0.175127