Python Forum

Full Version: pandas best way to add a new row in a already existing dataframe
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello,

i have a dataframe and i would like to add a new row to it.
i am quite confused about which is the best way to do it:
I could manage the row to be what i want list, dict, series, dataframe
all is possible but which is the best way?

to my understanding making a dataframe from a dict (and then add it) should be the most favorite

while i am here i have also another doubt about this already working code
test = web_scraping.quote(i)
page = pd.DataFrame.from_dict(test, orient='index').T
df = df.append(page)
something says me that the transpose ".T" i am doing isn't necessary if i pass the dict in the right way, but how?