2
Good night, I’m having a problem of putting together more than 500 csv files, where I need a very important data that is in a row (A8), but it needs to turn column (like this in the second image), I’m trying to use the function iloc, but it’s not working, to join all the spreadsheets I am using this code, but before I need the dataframe to be like in the second photo, since I thank you for the help of all and for the suggestions:
path = r'C:/PJS_PY/HMR_DTS/DTS_BSE'
all_files = glob.glob(path + "/*.csv")
li = []
for filename in all_files:
df = pd.read_csv(filename, sep=';', skiprows=range(0,8))
li.append(df)
frame = pd.concat(li, axis=0, ignore_index=True)
I would suggest changing the title of the question slightly since, as it stands, it suggests that your problem is much more general than it really is. By the way, if someone comes here to know how to transpose a pandas dataframe, just do
df.T
– Lucas