I have a ndarray
like this one:
In [75]:
z_r
Out[75]:
array([[ 0.00909254],
[ 0.02390291],
[ 0.02998752]])
In here, I want to ask how to convert those things to series
, the desired output is like this:
0 0.00909254
1 0.02390291
2 0.02998752
You can use this one:
my_list = map(lambda x: x[0], z_r)
ser = pd.Series(my_list)
In [86]:
ser
Out[86]:
0 0.009093
1 0.023903
2 0.029988
Actually, your question is how to convert to series ^^
pd.Series(my_ndarray)
no need to convert it first to a list then to series.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With