Skip to content

Instantly share code, notes, and snippets.

@vinaykudari
Last active July 24, 2018 10:55
Show Gist options
  • Save vinaykudari/81870347e4a32db14c6ae2d1da062fe4 to your computer and use it in GitHub Desktop.
Save vinaykudari/81870347e4a32db14c6ae2d1da062fe4 to your computer and use it in GitHub Desktop.
Reshape
a = np.arange(4)
print(a,'\n')
>> [0 1 2 3]
b = np.reshape(a,(2,2))
print(b, '\n')
>> [[0 1]
[2 3]]
c = b.reshape(4)
print(c)
>> [0 1 2 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment