Time series analysis with python



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.


Can you share the error that you are getting?


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


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)


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