Shailab Singh Shailab Singh - 4 months ago 7
Python Question

Retrive a column in pandas

print(pd.read_excel(File,Sheet_Name,0,None,0,None,["Column_Name"],1))


Since i am a noob to pandas i want to retrive a column of ExcelSheet using pandas in the form of array. I tried the code above but it didn't really work.

Answer

The way to do it is:

import pandas as pd
df = pd.read_excel(File,sheetname=Sheet_Name)

print(df['column_name'])