Python Pandas read_excel returns empty Dataframe -


reading simple xls returning empty dataframe, can't figure out life of me:

path = ('c:/users/desktop/stuff/ready') files = os.listdir(path) print(files)  files_xlsx = [f f in files if f[-3:] == 'xlsx']  readyorders = pd.dataframe() filename in files_xlsx:     open(os.path.join(path, filename)) f:         data = pd.read_excel(f)         readyorders = readyorders.append(data)  print(readyorders) 

the excel 2 simple columns...is in day?

f[-3:] == 'xlsx' never true, evaluating last 3 characters , comparing string of 4 characters.

try f[-4:] == 'xlsx'

as aside, appending dataframes slow. try concatenating instead:

readyorders = pd.concat([pd.read_excel(f) f in files if f[-5:] == '.xlsx'] 

Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -