Be able to handle time delta
aeturrell opened this issue · 3 comments
aeturrell commented
Currently, this data type is converted to strings.
eg
import pandas as pd
df_check = pd.DataFrame(
{
"header": [pd.Timedelta(365, "d"), pd.Timedelta(-19, "d")],
"header_1": ["length_one", "length_two"],
}
)
skim(df_check)
should produce a table with a time difference section.
aeturrell commented
Needs to be fixed for pandas 2.0.
aeturrell commented
df = pd.DataFrame({'col1': [pd.Timedelta('1 day'), pd.Timedelta('2 days')], 'col2': [pd.Timedelta('3 days'), pd.Timedelta('4 days')]})
# Check if the column is of type timedelta
is_timedelta = df['col1'].dtype == 'timedelta64[ns]'
print(is_timedelta)
print(df.apply(pd.api.types.infer_dtype))
all seems to work in detecting timedelta.