The following is a Pandas dataframe df
index_column value_column
0 20
2 28
1 30
It needs to be converted into a numpy array where index_column
becomes the index of numpy array and value_column
becomes the corresponding value.
That is np_arr[0]=20
, np_arr[1]=30
, np_arr[2]=28
and so on.
How can this be achieved?