I have a custom column in my dataframe that takes the difference between two other columns (start time and end time). This column returns number of days as timedelta values. When I try to use this data in statistical functions like scatter plotting or pivot tables I find that the data is not useable. Is there any way to convert this data to integers?
I tried something like this to convert the data:
df['integer'] = []
for i in df['timedelta']:
df['integer'].append(i.days)
print(df['integer']
However, this returned the following error: ValueError: Length of values does not match length of index. Is this because I can't iterate over null values? Is there someway to get around this? Appreciate any clarification.