Error: `raise ValueError( ValueError: Missing column provided to 'parse_dates': 'Date'
I am using a .csv
with two columns. The first has dates and the second has temperatures. I would like to plot it with dates on the x-axis and temperatures on the y-axis.
I used this command:
dataset = pandas.read_csv('/home/UbuntuUser/Desktop/mesurements.csv',
usecols=[1], engine='python', skipfooter=3, index_col=['Date'],
parse_dates=['Date'])
but I got the error:
Error: raise ValueError(
ValueError: Missing column provided to 'parse_dates': 'Date'
Any ideas why? From searching, I found this suggestion, that does not help me.
Update:
Part of the code is from here:
import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import fft, ifft
import pandas as pd
# Import csv file
df = pd.read_csv('rsam_2016-17_fft_test.csv', index_col=['DateTime'], parse_dates=['DateTime'])
print(df.head())
#plot data
plt.figure(figsize=(12,4))
df.plot(linestyle = '', marker = '*', color='r')
plt.savefig('rsam_2016_2017_snippetforfft.jpg')
plt.show()
Category Data Science