Reputation: 95
How do I select a column in an excel file and display it only by pandas I tried:
videos = df.loc[:, df.columns == 'videos']
videosvar = (videos.loc[num].values)
print(videosvar)
Upvotes: 2
Views: 226
Reputation: 862851
If need select by indice and column name use:
videosvar = df.loc[num, 'videos']
Upvotes: 1
Reputation: 696
You can select column by directly mentioning the column name.
videos_column = videosvar["videos"] # returns the column as a series
Upvotes: 1