0
import pandas as pd

data1 = pd.read_excel(U"D:/data/data/000852.SZ.xls")
data2 = pd.read_excel(U"D:/data/data/000526.SZ.xls")
print(data1)
print(data2)

How do I use the Panda function to do a single read on multiple Excel files, instead of repeating the same code and reading each file step by step?

David Parks
  • 30,789
  • 47
  • 185
  • 328
pric
  • 11
  • 2
    Welcome to Stack Overflow! Please take the [tour] and read [ask]. What do you mean by "at a time"? You can [edit] to clarify. – wjandrea Dec 29 '21 at 03:18
  • emm,I mean, how do I use the Panda function to do a single read on multiple Excel files, instead of repeating the same code and reading each file step by step:) – pric Dec 29 '21 at 03:27
  • Does this answer your question, the same applies for `read_csv` as `read_excel`? [Import multiple csv files into pandas and concatenate into one DataFrame](https://stackoverflow.com/questions/20906474/import-multiple-csv-files-into-pandas-and-concatenate-into-one-dataframe) – David Parks Dec 29 '21 at 03:29
  • ok,i know what to do,ty – pric Dec 29 '21 at 03:39

0 Answers0