Created
August 27, 2013 19:24
-
-
Save greggyNapalm/6357893 to your computer and use it in GitHub Desktop.
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
import numpy as np | |
>>> np.__version__ | |
'1.6.1' | |
>>> errno_distr = # getter function call here | |
>>> type(errno_distr) | |
<type 'numpy.ndarray'> | |
>>> errno_distr | |
array([[ 0. , 39597. , 99.99242424], | |
[ 104. , 1. , 0.00252525], | |
[ 110. , 2. , 0.00505051]]) | |
>>> errno_distr.dtype | |
dtype('float64') | |
>>> errno_distr.shape | |
(3, 3) | |
>>> errno_distr[:,0] | |
array([ 0., 104., 110.]) # this is what I what to get in errno_distr['code'] call | |
>>> errno_distr.dtype = [('code', float),('count', float),('percentage', float)] | |
>>> errno_distr.shape # why shape changes? I no need that | |
(1, 3) | |
>>> errno_distr[:,0] | |
array([(0.0, 104.0, 110.0)], | |
dtype=[('code', '<f8'), ('count', '<f8'), ('percentage', '<f8')]) | |
>>> errno_distr['code'] # unexpected result ( | |
array([[ 0. , 39597. , 99.99242424]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment