Relative Content

Tag Archive for pythondataframe

How to convert datetime64[ns] with multiple timezones to UTC

I have a dataframe with two columns, the first one has a date and time (type: datetime64[ns]) and the second column has the timezone that it is in. I cannot figure out how to convert each of the times to UTC based on their individual timezone.

How can i develop a python code to calculate Development factors ? (used in credit risk management)

So i have a data frame with row labels as months and the columns are amounts in float format, i need to sum and multiply the columns in such a way, in which the numbers of rows when the code takes to calculate the sum changes are according to the user, which means the user should be able to take 12 months values 24 etc. The summation of the columns should be divided by the previous column, so the division should be Current_sum(Column) / Previous_sum(Column). The sum should be in such a way in which the code should exclude the last row of the DataFrame when it sums to 12 or 24 values according to user.

Problem with added dataframe column shift

I tried to apply my newly acquired pandas skills to a typical ANOVA calculation on large dataset with 5, partially nested indices. The corresponding dataframe “dSchema” looks like this: