Answers for "dataframe to array or list"

8

dataframe to list

df.values.tolist()
Posted by: Guest on April-18-2020
0

list dataframe to numpy array

df.values

array([[nan, 0.2, nan],
       [nan, nan, 0.5],
       [nan, 0.2, 0.5],
       [0.1, 0.2, nan],
       [0.1, 0.2, 0.5],
       [0.1, nan, 0.5],
       [0.1, nan, nan]])
Posted by: Guest on September-06-2020

Python Answers by Framework

Browse Popular Code Answers by Language