Whenever set my DataFrame index to a list of datetime's, the Dataframe zeros out all my quantities.
df = pd.DataFrame(
{
"code": pd.Series(mem_code, dtype="pint[byte]"),
"data": pd.Series(mem_data, dtype="pint[byte]"),
"heap": pd.Series(mem_heap, dtype="pint[byte]"),
"stack": pd.Series(mem_stack, dtype="pint[byte]"),
"total": pd.Series(mem_total, dtype="pint[byte]"),
},
index=pd.DatetimeIndex(dt)
)
print(f"df: {df.pint.dequantify()}")
df: code data heap stack total
unit B B B B B
2017-01-01 12:00:00 NaN NaN NaN NaN NaN
2017-01-02 12:00:00 NaN NaN NaN NaN NaN
2017-01-03 12:00:00 NaN NaN NaN NaN NaN
I'm new to pandas and pint. My goal here is to use quantities (for units) rather than multiplying manually. In otherwords, the units should be used in the view, not be baked in to the model data.
I've been following examples such as How can I manage units in pandas data?
Nothing I've tried can get both the datetime indexes and the bytes quantities to work.
Am I doing something wrong or is pint_pandas still in its early days?