I would like to have the two tables that I read in, stored in data frames.
I'm reading a h5 file into my code with:
with pd.HDFStore(directory_path) as store:
self.df = store['/raw_ti4404']
self.hr_df = store['/metric_heartrate']
self.df is being stored as a data frame, but self.hr_df is being stored as a series.
I am calling them both in the same manner and I don't understand why the one is a data frame and the other a series. It might be something to do with how the data is stored:
Any help on how to store the metric_heartrate as a data frame would be appreciated.
Most probably the
metric_heartrate
was stored as Series.Demo:
Generate sample DF:
Let's store
a
column as Series:Let's store a DataFrame, containing only one column -
a
:Reading data from HDFStore:
Fix - read Series and convert it to DF: