python - convert a column in a dataframe into a list
myvar_list = df["myvar"].tolist()
python - convert a column in a dataframe into a list
myvar_list = df["myvar"].tolist()
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)))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us