Time series analysis with python

data_science
python

#1

data = pd.read_csv(‘AirPassengers.csv’, parse_dates=‘Month’, index_col=‘Month’,date_parser=dateparse)

Reading Time series analysis with python article by Analytics vidhya, i’m getting an error in the above mentioned line.


#2

Can you share the error that you are getting?


#3

TypeError: Only booleans, lists, and dictionaries are accepted for the ‘parse_dates’ parameter


#4

Hi @ssonia

I got a similar error while implementing the code. parse_data parameter accepts only lists and dictionaries. So you have to give input for parse_data as['Month']

data = pd.read_csv(‘AirPassengers.csv’, parse_dates=[‘Month’], index_col=‘Month’,date_parser=dateparse)


#5

try parse_dates=[‘Month’] instead of parse_dates=‘Month’