Python Forum

Full Version: Difference one column in a dataframe
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,

I have a dataframe (df2) with about 5 columns and I want to difference one column and keep the other columns. Do you know how I do that in python code.

df_differenced = df2.diff().dropna()
Thanks