Created
June 17, 2013 01:04
-
-
Save mkacky/5794077 to your computer and use it in GitHub Desktop.
test of resize()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
A = np.array([1,2,3]) | |
# >>> A | |
# array([1, 2, 3]) | |
#A.resize((2,4), refcheck=False) | |
A.resize((2,4)) | |
# >>> A | |
# array([[1, 2, 3, 0], | |
# [0, 0, 0, 0]]) | |
B = np.array([1,2,3]) | |
# >>> B | |
# array([1, 2, 3]) | |
B = np.resize(B, (2,4)) | |
# >>> B | |
# array([[1, 2, 3, 1], | |
# [2, 3, 1, 2]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment