Issue
I have a pandas dataframe with the column names A,B,C,D,E,F,G I'd like to create a list of all the column names except for the first 3 columns so that column_names would be ['D','E','F','G']
I tried:
column_names = list(df[3:])
However, I still get all of the column names in that list.
Solution
Try this:
column_names = yourdf.columns[3:].to_list()
Answered By - Alan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.