Hello guys i have another question
So I want to put multiple csv files together and were running into sort of a problem.
So the code:
import glob
import pandas as pd
# get data file names
path =r'C:\Users\spkso\Desktop\in'
filenames = glob.glob(path + "/*.csv")
dfs = []
for filename in filenames:
print(filename)
csv=pd.read_csv(filename)
dfs.append(csv)
print(dfs)
returns this:
C:\Users\spkso\Desktop\in\qbr2014.csv
C:\Users\spkso\Desktop\in\qbr2015.csv
C:\Users\spkso\Desktop\in\qbr2016.csv
[ QB Rating
0 Andrew Luck 96.5
1 Drew Brees 92.4
2 Tom Brady 95.2, QB Rating
0 Andrew Luck 90.4
1 Drew Brees 95.6
2 Tom Brady 99.8, QB Rating
0 Andrew Luck 101.2
1 Drew Brees 94.6
2 Tom Brady 100.3]
The only problem i am having with this code is the fact that there are two headers QB Rating outside of the list
Do you guys have any suggestions
It would be much appreciated