简体   繁体   中英

how can I loop and perform operations on columns of a pandas dataframe?

I've imported the fitter package which plots the top 5 plots for a distribution of a series

f=Fitter(df.distance)
f.fit()
f.summary()

distance is one of the columns of my dataframe. how can I apply the fitter function to plot the graphs of each series?

If I'm understanding correctly you want to apply Fitter to multiple columns in your df in a loop:

for col in df.columns:
    f=Fitter(df[col])
    f.fit()
    f.summary()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM