I have the following data array ( ‘first_row’ from the following code ) as object parsed with pandas from an .xlsx file ( 1st row ) and I want to transform it in a list vector and I do not know how to parse it further. Can you help me?
import pandas as pd
#........
# Path to the .xlsx file
path = r"C:Users...DesktopBook1.xlsx"
# Sheet from the file to be extracted
mapSheetName = "Text"
# Get data from excel file
the_data = pd.read_excel(path, sheet_name=mapSheetName, usecols=[0,1,2]) #<----- columns which will be parsed
# Parse the loaded data
parse_data = pd.DataFrame(the_data)
first_row = parse_data.columns
# Show first row
print(first_row )
#........
#Output
#Index(['animals', 'dogs', 'cats'], dtype='object')
#........
Thank you
1