0

I have to fetch csv-content from multiple web-sources and append it to one file. The number of web-sources is variant, it depends on an excel-file which contains all urls.

For this reason, I generated a list (named dataList) in python, each element contains one url from the excel file.

After that, to get the data from the urls, I used a for-loop:

for k in range(count_dataList):
    dataContent.insert(k, pd.read_csv(dataList[k]))

Now, a list exists where each element contains the data from the source. I guess as a DataFrame.

At last, I have to append all elements to one DataFrame. But I can't find any way to append all datas.

AMC
  • 2,642
  • 7
  • 13
  • 35
Nico
  • 11
  • 3
  • Please see [ask], [help/on-topic]. As an aside, why are you seemingly mixing multiple style conventions? It's probably best to just stick to `lower_case_with_underscores` for functions and variables. – AMC May 01 '20 at 12:03
  • Does this answer your question? [Append multiple pandas data frames at once](https://stackoverflow.com/questions/36526282/append-multiple-pandas-data-frames-at-once) – AMC May 01 '20 at 12:03

1 Answers1

0

You can use pd.concat:

df = pd.concat(pd.read_csv(source) for source in dataList)
nik7
  • 806
  • 3
  • 12
  • 20
  • https://stackoverflow.com/questions/36526282/append-multiple-pandas-data-frames-at-once – AMC May 01 '20 at 12:03