3

i want to convert this nested array into single pandas dataframe column, how can I do that? can anyone help me please?

    array([array([          nan,   16.40411828,   23.67187877,   27.19289145,
             31.48879139,   28.50329298,   25.16148811,   24.32455519,
             23.72071149,   22.96651751,   21.79875539,   21.05904285,
             20.65603351,   20.99366119,   21.52619114,   22.87522069,
             21.63331813,   21.93181362]),
           array([nan, 30.44444767, 29.96125493, 25.69240818, 23.96278846, 25.00461946, 24.78053007, 23.65561137, 23.9937393 , 24.06364734,
           26.85976645, 28.77707529, 30.45483929, 30.3066284 , 29.2685211 ,
           28.41220814, 27.22663736, 29.30175533]) 

array([nan, 30.44444767, 29.96125493, 25.69240818, 23.96278846, 25.00461946, 24.78053007, 23.65561137, 23.9937393 , 24.06364734,
           26.85976645, 28.77707529, 30.45483929, 30.3066284 , 29.2685211 ,
           28.41220814, 27.22663736, 29.30175533, 30.19692369, 26.90048144,
           24.29289412, 23.86300245, 22.48910863, 22.66028583, 22.25506455,
           22.26521476, 22.08912783, 23.05146134, 22.0568987 , 21.00369025,
           20.71023731, 19.48245301, 18.88289262]) ])

pandas single column:

0   NaN
1   30.444448
2   29.961255
3   25.692408
4   23.962788
5   25.004619
6   24.780530
7   23.655611
8   23.993739
9   24.063647
10  26.859766
11  28.777075
12  30.454839
13  30.306628
14  29.268521

1 Answer 1

2

Maybe try with concatenate

pd.Series(np.concatenate(a))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.