sayan_sen
sayan_sen

Reputation: 345

Unable to get describe method work while iterating through a list of column names

My code is as below:

       Col_list=['A','B','C']
       for col in col_list:
           df.col.describe()

My intention above is to iterate through a list few column names which are also present in the DF and then get describe() method work. What can I try next?

Upvotes: 0

Views: 33

Answers (1)

Python29
Python29

Reputation: 112

Try this:

Col_list=['A','B','C']
for col in col_list:
    df[col].describe()

Upvotes: 1

Related Questions