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()
turn columns into one column as list python
t['combined']= t.values.tolist()
t
Out[50]:
A B C D combined
0 hello 1 GOOD long.kw [hello, 1, GOOD, long.kw]
1 1.20 chipotle NaN bingo [1.2, chipotle, nan, bingo]
2 various NaN 3000 123.46 [various, nan, 3000, 123.456]
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