Several numpy arrays to single pandas datafram

I have several numpy arrays:

ema9 = talib.EMA(amzn['Close'].values, 9) ema10 = talib.EMA(amzn['Close'].values, 10) ema11 = talib.EMA(amzn['Close'].values, 11) 

I’d like to get them all organised into a single panda df. How can I do this? Please help. Thank you.

Add Comment
2 Answer(s)

You can put all your arrays in a list and do a pd.concat

list_of_arrays = [ema9, ema10, ema11] single_pandas_df = pd.concat(list_of_arrays, axis=0, ignore_index=True) 
Add Comment

This did it:

single_pandas_df = pd.DataFrame(np.array(list_of_arrays).T)

Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.