title: MATLAB ind2sub equivalent in Python
body: <p>Matlab has two functions for converting matrix subscripts to linear indices and vice versa. (ind2sub and sub2ind)</p>
  
  <p>I found the equivalent for R but is there an equivalent way in Python?</p>