i am trying to convert the below pandas dataframe,
pd.DataFrame({'PE': [115.45, 8], 'PE FY1': [11, 12], 'EV/Sales':[0.4, 1.9], 'EV/EBIT':[16, 9.8],
'EV/EBITDA': [10.8, 7.5]})
to an np.array but within multiple square brackets - as below - but have so far been unsuccesful. I am unsure of the correct name of this structure but need it in this for scikit learn. I the below works for what i am trying to do, just a matter of getting there.
q = np.array([[[115.45,11.00,0.40,16.00,10.80]], [[8.00,12.00,1.90, 9.80,7.50]]])
whatever i try i either end up with normal brackets in the wrong place or IndexError: tuple index out of range as i run it through the regressor and tree interpretor - as below
Latest_feature_values = pd.DataFrame({'PE': [115.45, 8], 'PE FY1': [11, 12], 'EV/Sales':[0.4, 1.9], 'EV/EBIT':[16, 9.8],
'EV/EBITDA': [10.8, 7.5]})
Latest_feature_values = np.array(Latest_feature_values.values)