0

I intended to plot a trend of daily BTC prices, which is recorded as a csv file, consisting of a sequence of 3892 numbers. Being a csv file, I could use microsoft excel to plot the trend. It looks like this;

enter image description here

Meanwhile, I attempted to do the same thing using pandas and matplotlib in a jupyter notebook, which doesn't look good;

enter image description here

What's wrong with my implementation? One more thing is the implementing time ; it takes a quite a while, like one or two minute. This is not the case when I put a code and implement like this ;

plt.plot(list(range(1000)),list(range(1000)))

Here is the full code for my attempt.

import pandas as pd
from matplotlib import pyplot as plt
df=pd.read_csv('BTC_inv_daily.csv')
Close=df['Close'].tolist()
N=len(Close)
plt.plot(list(range(N)),Close)
plt.show()
govin
  • 125
  • 4
  • Sample and plot. Choose part of the data, don't plot the whole thing. Maybe you wanna aggregate every 5 timestep. Also, try using scatter plot. – Vishnudev Krishnadas Mar 16 '21 at 07:48
  • @Vishnudev Do you mean that the number 3892 is too big? Like chopping all the things into 3892/5 ? – govin Mar 16 '21 at 08:11
  • @JohanC Thanks. I think that's the point. I'm tackle on resetting the type of the component of the sequence, from string to float. Still fighting against the problem of eliminating commas in numbers. but affirmative. Thanks! – govin Mar 16 '21 at 11:06
  • Maybe `df = pd.read_csv(Input, delimiter=";", decimal=",")` as in [Convert commas decimal separators to dots within a Dataframe](https://stackoverflow.com/questions/31700691/convert-commas-decimal-separators-to-dots-within-a-dataframe)? – JohanC Mar 16 '21 at 11:16

0 Answers0