0

How to say in python "from the beginning of the array" and "all the array". For example if my code in Matlab is:

images(:, n) = img(:)

What is its equivalent in python?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
user2229953
  • 1,569
  • 3
  • 16
  • 24
  • 5
    http://www.scipy.org/NumPy_for_Matlab_Users – NPE Apr 07 '13 at 11:26
  • 5
    Are you using numpy? If you're coming from matlab, that's the package you should be looking at. Read a tutorial and your code will become `images[:, n] = img`. – jorgeca Apr 07 '13 at 11:28
  • @NPE: Much better reference. `array` is so often used when `list` is meant that I assumed the latter was meant. – Martijn Pieters Apr 07 '13 at 11:31

1 Answers1

1

It is images[:,n] = img.ravel()

pv.
  • 33,875
  • 8
  • 55
  • 49