Last answered:

08 Apr 2023

Posted on:

18 Jan 2023

0

Don't understand the code at 3'40

I don't understand this line of code, 'lending_co_data_numeric = lending_co_data_numeric[np.argsort(lending_co_data_numeric[:,0])]'. What does it mean that the 'lending_co_data_numeric' is followed by a blanket with an array in it?

1 answers ( 0 marked as helpful)
Posted on:

08 Apr 2023

0

Hi Xinyi Li, we are trying to sort the lending_co_data_numeric on the first column and return the indexes of the sorted array of the first column using np.argsort(lending_co_data_numeric[:,0])

Once the sorted indexes have been returned, we pass those indexes to the original array to return the array arranged by the sorted index


lending_co_data_numeric[array([537, 639, 849, ..., 27, 277, 420])]

Submit an answer