Does anyone know how to incorporate a forloop for columns but start at any column? (The third one for this scenario)
Lets say this is the dataframe:
spice smice skice bike dike mike
1 23 35 34 34 56
135 34 23 21 56 34
231 12 67 21 62 75
I want to iterate through skice, bike, dike, and mike only
Since df.columns
provides you the list of columns, you can do below and iterate from 3rd column name.
for col in df.columns[2:]:
#print(df[col].unique())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With