Created
January 12, 2019 18:38
-
-
Save saivarunk/4cabd837493d3ea3e0691a4a99cdf69b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # read bitcoin pricing data | |
| bitcoin_data = pd.read_csv('input/bitstampUSD_1-min_data_2012-01-01_to_2018-11-11.csv') | |
| # parse date using pandas | |
| bitcoin_data['date'] = pd.to_datetime(bitcoin_data['Timestamp'],unit='s').dt.date | |
| # group by date and pick 'Weighted_Price' | |
| grouped_data = bitcoin_data.groupby('date') | |
| real_price = grouped_data['Weighted_Price'].mean() | |
| # prepare data for plot.ly | |
| data = [go.Scatter(x=real_price.index, y=real_price.values)] | |
| # plot time series data | |
| plotly.offline.iplot(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment