'I have an excel file which contains many columns with strings, but i want to import certain columns of this excel file containing 'NGUYEN'.
I want to generate a string from columns in my excel which had 'NGUYEN' in them.
import pandas as pd
data = pd.read_excel("my_excel.xlsx", parse_cols='NGUYEN' in col for cols in my_excel.xlsx, skiprows=[0])
data = data.to_string()
print(data)
SyntaxError: invalid syntax
my_excel.xlsx
Function output should be
data = 'NGUYEN VIETNAM HANOIR HAIR PANTS BIKES CYCLING ORANGE GIRL TABLE DARLYN NGUYEN OMG LOL'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…