Skip to content

Instantly share code, notes, and snippets.

@mkacky
Created June 17, 2013 01:04
Show Gist options
  • Save mkacky/5794077 to your computer and use it in GitHub Desktop.
Save mkacky/5794077 to your computer and use it in GitHub Desktop.
test of resize()
#! /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