title: Sorting binary matrix columns based on most significant bit in python
body: <p>So I have a 2D array that looks like: <code>[[0, 1, 1][1, 0, 0][0,0,1]]</code> where all the values are stored as ints but they represent the actual bit. The values in the first row are considered the most significant. Assuming each column is some integer based on the bits in the column, I would like to sort the columns in decreasing order, so that it looks like <code>[[1,1,0][0,0,1][0,0,1]]</code>. However, I'm very lost on how to achieve this in python. It was suggested that I use radix sort, but I'm lost on how this helps me in my case. I've written the two matrices below so it's easier to visualize.</p>
  
  <p><code>011   110
   100   001
   001   100</code></p>
  
  <p>My approach: read each column, convert to int, sort the ints, map back to column. But this approach can be very convoluted if I'm wokring with matrices with dimensions <code>1000x10000</code></p>
  
  <p>But I feel as though there should be a more clever way to do this, especially in python. How should I approach this?</p>