Skip to content Skip to sidebar Skip to footer

Iterating Through A Column In Dataframe And Creating A List With Name Of The Column + Str

I have a dataframe with 2 coulmn, i want to iterate through the column headers, use that value and add a string to it and use it as the name of a list. rr resampled=pd.DataFrame()

Solution 1:

have you tried list comprehension?

[x+'stuck' for x in rr.columns]

Post a Comment for "Iterating Through A Column In Dataframe And Creating A List With Name Of The Column + Str"