What is the process for sorting arrays by the nth column in Python?

I want to yield this result using code, by sorting the integers in a column and rows sorting themselves accordingly. Can anyone give me the code for this?

Screenshot 2023-03-01 005014