Issue
im getting this issue with plotting timeseries data where indexing the date produces weird plots. I have also tried plot(x='Date', y='values')
but produced weird plots.
# splitting the column to account for date time.
new = df["Gmt time"].str.split(" ", n = 1, expand = True)
df["Date"]= new[0]
df["Time"]= new[1]
df['Date'] = pd.to_datetime(df['Date'])
df.plot(x='Date', y='Close')
df = df.set_index(df['Date'])
Output of code after setting the date as index.
really appreciate if you could let me know where my code has gone wrong or an issue to fix the following.
Solution
Problem solved by adding dayfirst=True in read_csv(). Data was taken from dukascopy as a csv file.
Answered By - Anthony
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.