Skip to content

Commit 0eeef30

Browse files
authored
initial commit
0 parents  commit 0eeef30

File tree

3 files changed

+173
-0
lines changed

3 files changed

+173
-0
lines changed

check.ipynb

+130
Large diffs are not rendered by default.

data.csv

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Date,Open,High,Low,Close,Adj Close,Volume
2+
2019-05-18,7266.080078,8281.660156,7257.259766,8193.139648,8193.139648,723011166
3+
2019-05-19,8193.139648,8193.139648,7591.850098,7998.290039,7998.290039,637617163
4+
2019-05-20,7998.290039,8102.319824,7807.770020,7947.930176,7947.930176,357803946
5+
2019-05-21,7947.930176,8033.759766,7533.660156,7626.890137,7626.890137,424501866
6+
2019-05-22,7626.890137,7971.259766,7478.740234,7876.500000,7876.500000,386766321
7+
2019-05-23,7876.500000,8165.450195,7801.569824,7996.399902,7996.399902,413162746
8+
2019-05-24,7996.399902,8140.819824,7948.680176,8059.129883,8059.129883,179206342
9+
2019-05-25,8059.129883,8779.000000,7894.529785,8726.230469,8726.230469,483663699
10+
2019-05-26,8726.230469,8931.530273,8668.459961,8785.169922,8785.169922,507164714
11+
2019-05-27,8785.169922,8818.709961,8562.200195,8718.849609,8718.849609,360752199
12+
2019-05-28,8718.849609,8760.480469,8444.099609,8664.559570,8664.559570,380343928
13+
2019-05-29,8664.559570,9065.889648,8027.209961,8276.250000,8276.250000,815525590
14+
2019-05-30,8276.250000,8570.780273,8116.000000,8560.080078,8560.080078,500141087
15+
2019-05-31,8550.629883,8576.339844,8459.650391,8504.980469,8504.980469,69915456

plot.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import pandas as pd
2+
import matplotlib.pyplot as plt
3+
plt.style.use('seaborn')
4+
df = pd.read_csv('data.csv')
5+
print('Dates are between', df['Date'][0], 'and', df['Date'][13])
6+
df['Date'] = pd.to_datetime(df['Date'])
7+
df.sort_values('Date', inplace=True)
8+
while True:
9+
try:
10+
ds = pd.Timestamp(input("Enter start date :") + " 00:00:00")
11+
if (ds == df['Date']).any() == False: print("Enter start date again !! It is not in dataset")
12+
else: break
13+
except: print("Error !! Enter again.")
14+
while True:
15+
try:
16+
de = pd.Timestamp(input("Enter end date :") + " 00:00:00")
17+
if (de == df['Date']).any() == False: print("Enter start date again !! It is not in dataset")
18+
else: break
19+
except: print('Error !! Enter again.')
20+
dfm = df[(df['Date'] >= ds) & (df['Date'] <= de)]
21+
cols = ['Open', 'High', 'Low', 'Close', 'Adj Close']
22+
plt.figure(1, figsize=(8, 5))
23+
plt.title('Bitcoin Prices', fontdict={'fontweight': 'bold', 'fontsize': 20})
24+
for i in cols:
25+
plt.plot_date(dfm['Date'], dfm[i], '.-', label=i)
26+
plt.tight_layout()
27+
plt.legend(loc='upper left', frameon=True)
28+
plt.show()

0 commit comments

Comments
 (0)