2

現在、共有ポイントからデータを抽出し、Excel で開くことができる .iqy ファイルを持っています。約 30 個のファイルがあり、すべての情報を 1 つの .iqy ファイルまたは Python を使用した Excel ファイルにマージしようとしています。

import os, glob
import pandas as pd

files = []
for file in os.listdir("C:\\Users\\CHI86786\\Downloads"):
    files.append(file)

excels = [pd.ExcelFile(name) for name in files]
frames = [x.parse(x.sheet_names[0], header=None, index_col=None) for x in excels]

frames[1:] = [df[1:] for df in frames[1:]]

combined = pd.concat(frames)
combined.to_excel("SPmerged.iqy", header=False, index=False)

Excelファイルをマージする場合と同じアプローチを取りました。しかし、次のようなエラーが表示され続けますFileNotFoundError: [Errno 2] No such file or directory: 'desktop.ini'

編集

エラーメッセージの詳細

File "C:\Users\CHI\source\repos\MergingExcel\MergingExcel\MergingExcel.py", line 8, in <module>
    excels = [pd.ExcelFile(name) for name in files] #reads names in
  File "C:\Users\CHI86786\source\repos\MergingExcel\MergingExcel\MergingExcel.py", line 8, in <listcomp>
    excels = [pd.ExcelFile(name) for name in files] #reads names in
  File "C:\Users\CHI\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pandas\io\excel.py", line 394, in __init__
    self.book = xlrd.open_workbook(self._io)
  File "C:\Users\CHI\AppData\Local\Programs\Python\Python37-32\lib\site-packages\xlrd\__init__.py", line 116, in open_workbook
    with open(filename, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'desktop.ini'
4

1 に答える 1