Answers for "how to convert a pandas series to a numpy array"

0

convert a pandas df to a numpy array

x = df.to_numpy()
x
Posted by: Guest on August-02-2021
0

pandas series to numpy array

ser = pd.Series(pd.Categorical(['a', 'b', 'a']))
>>> ser.to_numpy()
array(['a', 'b', 'a'], dtype=object)
Posted by: Guest on November-15-2021

Code answers related to "how to convert a pandas series to a numpy array"

Python Answers by Framework

Browse Popular Code Answers by Language