ERROR: "Resample() got an unexpected keyword argument 'how'"

Viewed 2470

The Code

symbol_1_data = symbol_1_data.resample('5T', how=ohlc_dict, closed='left', label='left')

The Error

Resample() got an unexpected keyword argument 'how'

Question 'how' is the expected argument for the resample command (syntax below), so why does it give me this error? could this be a config issue?

DataFrame.resample(rule, how=None, axis=0, fill_method=None, closed=None, label=None, convention=’start’, kind=None, loffset=None, limit=None, base=0, on=None, level=None)
1 Answers

Alternatively, try:

symbol_1_data = symbol_1_data.resample('5T', closed='left', label='left').ohlc_dict()
Related