PERFORM-Forecasts / documentation

ARPA-E PERFORM Forecasts Documentation
17 stars 8 forks source link

Bug in Python examples section in ERCOT.md #11

Closed sotorrio1 closed 2 years ago

sotorrio1 commented 2 years ago

When running some of the Python examples in the ERCOT.md file, I run into some issues regarding the time index. The original line is:

time_index = pd.DatetimeIndex(f['time-index'][...])

But it generates the following error:

TypeError: <class 'bytes'> is not convertible to datetime

Please find below my suggested workaround:

time_arr = f['time_index'][...].astype('datetime64[ns]')
time_index = pd.DatetimeIndex(time_arr)

I first read the 'time_index' key from the h5 file into a Numpy array as 'datetime' type and then create the 'time_index' Pandas time series.

MRossol commented 2 years ago

Thanks @sotorrio1 the examples have been updated.

sotorrio1 commented 2 years ago

@MRossol Thank you!