Home > Blockchain >  Defining a column in an excel file using pandas
Defining a column in an excel file using pandas

Time:11-25

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)

CodePudding user response:

You can select column by directly mentioning the column name.

videos_column = videosvar["videos"]  # returns the column as a series

CodePudding user response:

If need select by indice and column name use:

videosvar = df.loc[num, 'videos']
  • Related