Answers for "python list of object to dataframe"

0

from list of lists to dataframe

import pandas as pd

data = [['New York Yankees', 'Acevedo Juan', 900000, 'Pitcher'], 
        ['New York Yankees', 'Anderson Jason', 300000, 'Pitcher'], 
        ['New York Yankees', 'Clemens Roger', 10100000, 'Pitcher'], 
        ['New York Yankees', 'Contreras Jose', 5500000, 'Pitcher']]

df = pd.DataFrame.from_records(data)
Posted by: Guest on June-04-2020
1

list of dataframe to dataframe

import pandas as pd
df = pd.concat(list_of_dataframes)
# easy way
Posted by: Guest on October-01-2021

Code answers related to "python list of object to dataframe"

Python Answers by Framework

Browse Popular Code Answers by Language