Importing datasets

We can import the datasets using the read_csv function provided by pandas:

dframe = pd.read_csv('bitcoin.csv')

Figure 12.2 shows how the dataset looks. We are using the same dataset. Since the timestamps are encoded in UNIX format, we are going to recode them:

dframe['date'] = pd.to_datetime(dframe['Timestamp'],unit='s').dt.date
group = dframe.groupby('date')
Real_Price = group['Weighted_Price'].mean()

The main reason we are transforming the timestamp is so that we can sort the dataset by date instead of by minutes. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.190.182