Answers for "python - convert a list column into miltiple columns"

0

python - convert a list column into miltiple columns

# Method 1
df[['team1','team2']] = pd.DataFrame(df.column_with_list.tolist(), index= df.index)

# Method 2
df['team1'], df['team2'] = list(zip(*((x[0], x[1]) for x in df['column_with_list'].values)))
Posted by: Guest on December-17-2020

Code answers related to "python - convert a list column into miltiple columns"

Python Answers by Framework

Browse Popular Code Answers by Language