728x90
In [ ]:
import matplotlib.pyplot as plt
import pandas as pd
import datetime
In [63]:
# data
return_df = pd.read_csv('coin_daily_returns.csv'); return_df
Out[63]:
Date | BTC | ETH | LTC | |
---|---|---|---|---|
0 | 2013-04-29 23:59 | 7.509441 | NaN | 0.392520 |
1 | 2013-04-30 23:59 | -3.472222 | NaN | -2.430554 |
2 | 2013-05-01 23:59 | -15.834534 | NaN | -11.388866 |
3 | 2013-05-02 23:59 | -9.597868 | NaN | -10.794653 |
4 | 2013-05-03 23:59 | -8.000000 | NaN | -10.191304 |
... | ... | ... | ... | ... |
2986 | 2021-07-02 23:59 | 1.035626 | 1.902831 | -0.258980 |
2987 | 2021-07-03 23:59 | 2.404788 | 3.500001 | 2.445841 |
2988 | 2021-07-04 23:59 | 1.794908 | 4.274493 | 3.269610 |
2989 | 2021-07-05 23:59 | -4.359843 | -5.311993 | -4.678025 |
2990 | 2021-07-06 23:59 | 1.517291 | 5.767275 | 0.749515 |
2991 rows × 4 columns
In [64]:
# Plot
return_df.plot.scatter('BTC','ETH', grid= True, figsize = (12,7))
Out[64]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f1197731d00>
728x90
'Data Analytics with python > [Data Analysis]' 카테고리의 다른 글
[matplotlib]S5_07_histogram (0) | 2023.01.21 |
---|---|
[matplotlib]S5_06_pie_chart (0) | 2023.01.21 |
[matplotlib]S5_04_Sub_plots (0) | 2023.01.21 |
[matplotlib]S5_03_Multiple_plots (0) | 2023.01.21 |
[matplotlib]S5_02_yahoo_finance (0) | 2023.01.21 |
댓글