728x90
In [29]:
import matplotlib.pyplot as plt
import pandas as pd
import datetime
In [32]:
investment_df = pd.read_csv('coin_daily_prices.csv')
investment_df
Out[32]:
Date | BTC-USD Price | ETH-USD Price | LTC-USD Price | |
---|---|---|---|---|
0 | 2013-04-29 23:59 | 134.444000 | NaN | 4.366760 |
1 | 2013-04-30 23:59 | 144.000000 | NaN | 4.403520 |
2 | 2013-05-01 23:59 | 139.000000 | NaN | 4.289540 |
3 | 2013-05-02 23:59 | 116.379997 | NaN | 3.780020 |
4 | 2013-05-03 23:59 | 106.250000 | NaN | 3.390440 |
... | ... | ... | ... | ... |
2986 | 2021-07-02 23:59 | 33549.600180 | 2109.892677 | 137.299274 |
2987 | 2021-07-03 23:59 | 33854.421360 | 2150.835025 | 136.930584 |
2988 | 2021-07-04 23:59 | 34665.564870 | 2226.550382 | 140.317998 |
2989 | 2021-07-05 23:59 | 35284.344430 | 2321.922836 | 144.849333 |
2990 | 2021-07-06 23:59 | 33723.509660 | 2197.919385 | 137.951668 |
2991 rows × 4 columns
plot(x=, y=, label=, linewidth=, figsize =)
In [37]:
# plot the data
investment_df.plot(x='Date', y='BTC-USD Price', label= 'Bitcoin Price', linewidth=3, figsize =(14,6))
plt.ylabel('Price [$]')
plt.xlabel('Date')
plt.title('BTC-USD Daily Price')
plt.legend(loc = 'upper right')
plt.grid()
728x90
'Data Analytics with python > [Data Analysis]' 카테고리의 다른 글
[matplotlib]S5_03_Multiple_plots (0) | 2023.01.21 |
---|---|
[matplotlib]S5_02_yahoo_finance (0) | 2023.01.21 |
[Pandas][DataFrame][MultiIndex]S4_05_Multi_indexing_operations2 (0) | 2023.01.21 |
[Pandas][DataFrame][MultiIndex]S4_04_Multi_indexing_operations1 (0) | 2023.01.21 |
[Pandas][DataFrame][MultiIndex]S4_03_Multi_index_dataframe (0) | 2023.01.21 |
댓글