I am a beginner trying to append rows of data via a for loop to a dataframe but keep getting
TypeError: first argument must be an iterable of pandas objects, you passed an object of type "Series"
Here is the relevant code:
myCols = ['Ticker', 'Name', 'Age', 'Height']
finalData = pd.DataFrame(columns=myCols)
listOfPerson=[{Name: 'John', Age: '27', Height '115'},{Name: 'Jill', Age: '25', Height '110'}] for person in listOfPerson: finalData.append(pd.Series([ person.name, person.age, person.height, 'N/A' ], index=myCols ), ignore_index = True, axis=1)
Any tips are appreciated and let me know if any further info is needed.
I have tried reading up on other forum posts and have tried .concat() but it also tells me it does not exist. I cannot seem to figure it out. Perhaps it is a datatype error and the documentation online is just confusing.