I have this dataframe
Begin End Duration ID
42 40680 40846 167 18
and I want to convert a numpy array in this form :
array([40680 , 40860 ,167,18])
I am using for conversion as_matrix function and I used after it
reshape(1,4) but it is not working!! It is getting me this format :
[[40680 40846 167 18]] any suggestions please ? I need to convert
it to that format so I can apply 'precision_recall_curve' function.
array.ravel()instead ofreshape. So, if the dataframe isdf:df.values.ravel()or simply :np.ravel(df).print(array)command, which per default doesn't show comas - try @ Divakar's solution:np.ravel(df)in iPython or in Jupiter