Skip to content Skip to sidebar Skip to footer

Python 3.5: Oserror: [errno 22] Invalid Argument: 'e:\\python\\sales Prog\nacenka.xlsx'

Have a nice error. import pandas as pd import xgboost as xgb sales_shop = pd.read_excel('E:\python\Sales prog\sales.xlsx', index_col = 'date') holidays = pd.read_excel('E:\python\S

Solution 1:

I would recomend you to sore the path in a variable once you have to use it multiple times, also you should follow the advices in the comments using \n can give you lots of troubles and in my case, using windows, i have to escape all the '\'.

try this:

import pandas as pd
import xgboost as xgb
salesPath = "E:\\python\\Sales prog\\"
sales_shop = pd.read_excel(salesPath+'sales.xlsx', index_col = "date")
holidays = pd.read_excel(salesPath+'holidays common.xlsx', index_col = "date")
datecom = pd.read_excel(salesPath+'date.xlsx', index_col = "date")
nacenka = pd.read_excel(salesPath+'nacenka.xlsx', index_col = "date")

Post a Comment for "Python 3.5: Oserror: [errno 22] Invalid Argument: 'e:\\python\\sales Prog\nacenka.xlsx'"