Код: Выделить всё
Excel file format cannot be determined, you must specify an engine manually.1- список столбцов идентификаторов клиентов:
Код: Выделить всё
customer_id = ["ID","customer_id","consumer_number","cus_id","client_ID"]
Код: Выделить всё
l = [] #use a list and concat later, faster than append in the loop
for f in glob.glob("./*.xlsx"):
df = pd.read_excel(f).reindex(columns=customer_id).dropna(how='all', axis=1)
df.columns = ["ID"] # to have only one column once concat
l.append(df)
all_data = pd.concat(l, ignore_index=True) # concat all data
Код: Выделить всё
df = pd.read_excel(f, engine="openpyxl").reindex(columns = customer_id).dropna(how='all', axis=1)Код: Выделить всё
BadZipFile: File is not a zip file
Версия Python: Python3.9
OS: MacOS
Есть ли лучший способ прочитать все файлы xlsx из папки?
Подробнее здесь: https://stackoverflow.com/questions/684 ... e-manually
Мобильная версия