In [1]:
import healpix_util as hu
import astropy as ap
import math, sys, time
import numpy as np
from astropy.io import fits
from astropy.table import Table
from astropy.table import vstack
import astropy.io.ascii as ascii
from astropy.constants import c
import matplotlib.pyplot as plt
import math
import scipy.special as sp
from scipy import integrate
from astropy.stats import bayesian_blocks
from astropy.stats import histogram
from astropy.visualization import hist
%matplotlib inline

In [ ]:
#Read DD values of each quasar/AGN pair
DD=ascii.read("./output/ddbin1pair.dat")
DD

In [6]:
#Creating output file 
findpair = open("./output/findpair.dat",'w')
# We intend to obtain average redshift of the pair and deltaZ deltatheta Zdeltatheta values first essentially finding right pairs
findpair.write("Z\t deltaZ\t deltatheta\t Zdeltatheta\n")
#Algorithm keeps removing rows after done finding quasars within deltaZ˜0.02 
start_time=time.time()
while len(hmqdat['Z'])>0:
    j=1
    while hmqdat[j]['Z']<=(hmqdat[0]['Z']+0.02):
        deltaZ=abs(hmqdat[j]['Z']-hmqdat[0]['Z'])
        Z=(hmqdat[j]['Z']+hmqdat[0]['Z'])/2.0
        RA1=hmqdat[0]['RA']*math.pi/180.0
        RA2=hmqdat[j]['RA']*math.pi/180.0
        DEC1=hmqdat[0]['DEC']*math.pi/180.0
        DEC2=hmqdat[j]['DEC']*math.pi/180.0
        deltatheta=abs(math.acos(math.sin(DEC1)*math.sin(DEC2)+math.cos(DEC1)*math.cos(DEC2)*math.cos(RA1-RA2)))
        Zdeltatheta=Z*deltatheta
        if Zdeltatheta<=0.02:
            findpair.write("%f\t %f\t %f\t %f\n" %(Z, deltaZ, deltatheta, Zdeltatheta))
        j=j+1
    hmqdat.remove_row(0)
findpair.close()
print "Total time taken to run: "
print time.time()-start_time


---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-6-ebf78828843e> in <module>()
      7 while len(hmqdat['Z'])>0:
      8     j=1
----> 9     while hmqdat[j]['Z']<=(hmqdat[0]['Z']+0.02):
     10         deltaZ=abs(hmqdat[j]['Z']-hmqdat[0]['Z'])
     11         Z=(hmqdat[j]['Z']+hmqdat[0]['Z'])/2.0

/Users/rohin/anaconda/lib/python2.7/site-packages/astropy/table/table.pyc in __getitem__(self, item)
   1196             return self.columns[item]
   1197         elif isinstance(item, (int, np.integer)):
-> 1198             return self.Row(self, item)
   1199         elif (isinstance(item, (tuple, list)) and item and
   1200               all(isinstance(x, six.string_types) for x in item)):

/Users/rohin/anaconda/lib/python2.7/site-packages/astropy/table/row.pyc in __init__(self, table, index)
     41         if index < -n or index >= n:
     42             raise IndexError('index {0} out of range for table with length {1}'
---> 43                              .format(index, len(table)))
     44 
     45     def __getitem__(self, item):

IndexError: index 1 out of range for table with length 1

In [ ]:
#Creating output file 
Ralpha = open("./output/Ralpha.dat",'w')
# We intend to obtain average redshift of the pair and deltaZ deltatheta Zdeltatheta R alpha values
Ralpha.write("Z\t deltaZ\t deltatheta\t Zdeltatheta\t R\t alpha\t \n")
#Algorithm keeps removing rows after done finding quasars within deltaZ˜0.02 
start_time=time.time()
while len(hmqdat['Z'])>0:
    j=1
    while hmqdat[j]['Z']<=(hmqdat[0]['Z']+0.02):
        deltaZ=abs(hmqdat[j]['Z']-hmqdat[0]['Z'])
        Z=(Z1+Z2)/2.0
        RA1=hmqdat[0]['RA']*math.pi/180.0
        RA2=hmqdat[j]['RA']*math.pi/180.0
        DEC1=hmqdat[0]['DEC']*math.pi/180.0
        DEC2=hmqdat[j]['DEC']*math.pi/180.0
        deltatheta=abs(math.acos(math.sin(DEC1)*math.sin(DEC2)+math.cos(DEC1)*math.cos(DEC2)*math.cos(RA1-RA2)))
        Zdeltatheta=Z*deltatheta
            if Zdeltatheta<=0.02:
                R=math.sqrt(deltaZ**2+Zdeltatheta**2)
                alpha=math.acos(deltaZ/R)
                Ralpha.write("%f\t %f\t %f\t %f\t %f\t %f\n" %(Z, deltaZ, deltatheta, Zdeltatheta, R, alpha))
        j=j+1
    hmqdat.remove_row(0)
Ralpha.close()
print "Total time taken to run: "
print time.time()-start_time

In [7]:
j


Out[7]:
1

In [8]:
hmqdat


Out[8]:
<Table length=1>
ZRADEC
float64float64float64
7.085170.0061676.690083

In [9]:
pairdat=ascii.read("./output/findpair.dat")

In [10]:
pairdat


Out[10]:
<Table length=6523551>
ZdeltaZdeltathetaZdeltatheta
float64float64float64float64
-0.00150.0010.539116-0.000809
-0.00150.0010.989785-0.001485
-0.0010.0021.952679-0.001953
-0.0010.0022.550885-0.002551
-0.0010.0022.466295-0.002466
-0.0010.0022.567833-0.002568
-0.0010.0022.530615-0.002531
-0.0010.0021.574572-0.001575
-0.0010.0022.372919-0.002373
-0.0010.0021.998327-0.001998
............
3.57550.0050.0035050.01253
3.5740.0020.005520.019727
3.57950.0110.0011660.004175
3.5820.0140.0034150.012232
3.58550.0070.0044150.01583
3.5960.0160.0020470.00736
3.59850.0170.0042210.015191
3.60.0180.003320.011952
3.5960.0060.003650.013124
3.5960.00.0029010.010434

In [19]:
pairdat.sort('Z')

In [16]:
pairdats=pairdat

In [17]:
pairdats


Out[17]:
<Table length=6523551>
ZdeltaZdeltathetaZdeltatheta
float64float64float64float64
-0.00150.0010.539116-0.000809
-0.00150.0010.989785-0.001485
-0.0010.0020.524223-0.000524
-0.0010.0020.729136-0.000729
-0.0010.0021.205034-0.001205
-0.0010.0020.938176-0.000938
-0.0010.0021.216635-0.001217
-0.0010.0020.992697-0.000993
-0.0010.0020.769144-0.000769
-0.0010.0020.686675-0.000687
............
3.57550.0050.0035050.01253
3.5780.0160.0036390.01302
3.57950.0110.0011660.004175
3.5820.0140.0034150.012232
3.58550.0070.0044150.01583
3.5960.0060.003650.013124
3.5960.0160.0020470.00736
3.5960.00.0029010.010434
3.59850.0170.0042210.015191
3.60.0180.003320.011952

In [22]:
pair_blocks=hist(pairdats['Z'],bins='blocks')



In [21]:
pairs_knuth=hist(pairdats['Z'],bins='knuth')



In [23]:
def AutoCorrelation(x):
    #x = np.asarray(x)
    y = x-x.mean()
    result = np.correlate(y, y, mode='full')
    result = result[len(result)//2:]
    result /= result[0]
    return result

In [24]:
DD=AutoCorrelation(pairs_knuth[0])

In [26]:
plt.plot(pairs_knuth[1][1:len(pairs_knuth[1])],DD)
plt.savefig("./images/DD_af_knuth.pdf")
plt.savefig("./images/DD_af_knuth.jpeg")



In [27]:
help(Table.add_column)


Help on method add_column in module astropy.table.table:

add_column(self, col, index=None, rename_duplicate=False) unbound astropy.table.table.Table method
    Add a new Column object ``col`` to the table.  If ``index``
    is supplied then insert column before ``index`` position
    in the list of columns, otherwise append column to the end
    of the list.
    
    Parameters
    ----------
    col : Column
        Column object to add.
    index : int or `None`
        Insert column before this position or at end (default)
    rename_duplicate : bool
        Uniquify column name if it already exist (default=False)
    
    Examples
    --------
    Create a table with two columns 'a' and 'b'::
    
        >>> t = Table([[1, 2, 3], [0.1, 0.2, 0.3]], names=('a', 'b'))
        >>> print(t)
         a   b
        --- ---
          1 0.1
          2 0.2
          3 0.3
    
    Create a third column 'c' and append it to the end of the table::
    
        >>> col_c = Column(name='c', data=['x', 'y', 'z'])
        >>> t.add_column(col_c)
        >>> print(t)
         a   b   c
        --- --- ---
          1 0.1   x
          2 0.2   y
          3 0.3   z
    
    Add column 'd' at position 1. Note that the column is inserted
    before the given index::
    
        >>> col_d = Column(name='d', data=['a', 'b', 'c'])
        >>> t.add_column(col_d, 1)
        >>> print(t)
         a   d   b   c
        --- --- --- ---
          1   a 0.1   x
          2   b 0.2   y
          3   c 0.3   z
    
    Add second column named 'b' with rename_duplicate::
    
        >>> t = Table([[1, 2, 3], [0.1, 0.2, 0.3]], names=('a', 'b'))
        >>> col_b = Column(name='b', data=[1.1, 1.2, 1.3])
        >>> t.add_column(col_b, rename_duplicate=True)
        >>> print(t)
         a   b  b_1
        --- --- ---
          1 0.1 1.1
          2 0.2 1.2
          3 0.3 1.3
    
    To add several columns use add_columns.


In [30]:
R=np.sqrt(pairdats['deltaZ']**2+(pairdats['Zdeltatheta'])**2)

In [31]:
R


Out[31]:
<Column name='deltaZ' dtype='float64' length=6523551>
0.00128606128869
0.00179004672537
0.0022292269767
0.0021520895157
0.002311934458
0.00208023630539
0.002285352415
0.0028272443826
0.00310334409638
0.0025454423944
0.00322552511666
0.003254806648
...
0.0198295971495
0.0141191705445
0.0134927469285
0.0206283616848
0.0117651921637
0.0185912557457
0.0173086205675
0.0176120554639
0.0144317748444
0.010431996
0.0227972339893
0.021606718955

In [34]:
Rdat=pairdats.Column(name='R',data=R)
pairdats.add_column(Rdat)

In [35]:
pairdats


Out[35]:
<Table length=6523551>
ZdeltaZdeltathetaZdeltathetaR
float64float64float64float64float64
-0.00150.0010.539116-0.0008090.00128606128869
-0.00150.0010.989785-0.0014850.00179004672537
-0.0010.0020.984608-0.0009850.0022292269767
-0.0010.0020.794663-0.0007950.0021520895157
-0.0010.0021.159759-0.001160.002311934458
-0.0010.0020.572174-0.0005720.00208023630539
-0.0010.0021.105819-0.0011060.002285352415
-0.0010.0021.998327-0.0019980.0028272443826
-0.0010.0022.372919-0.0023730.00310334409638
-0.0010.0021.574572-0.0015750.0025454423944
...............
3.57550.0050.0035050.012530.0134927469285
3.5780.0160.0036390.013020.0206283616848
3.57950.0110.0011660.0041750.0117651921637
3.5820.0140.0034150.0122320.0185912557457
3.58550.0070.0044150.015830.0173086205675
3.5960.0160.0020470.007360.0176120554639
3.5960.0060.003650.0131240.0144317748444
3.5960.00.0029010.0104340.010431996
3.59850.0170.0042210.0151910.0227972339893
3.60.0180.003320.0119520.021606718955

In [36]:
alpha=np.arccos(pairdats['deltaZ']/pairdats['R'])


/Users/rohin/anaconda/lib/python2.7/site-packages/ipykernel/__main__.py:1: RuntimeWarning: invalid value encountered in divide
  if __name__ == '__main__':

In [37]:
alpha


Out[37]:
<Column name='deltaZ' dtype='float64' length=6523551>
0.680007633186
0.978045564681
0.457471875897
0.378203831404
0.525493621222
0.278644209975
0.505074247406
0.784979738416
0.870471520917
0.666940281126
0.901984698482
0.909074940238
...
1.46976520295
1.20881436555
1.19117426594
0.683081894981
0.362646215648
0.718122811461
1.15444874925
0.431190943163
1.1420298228
1.57079632679
0.729204740345
0.586154176817

In [38]:
alphadat=pairdats.Column(name='alpha',data=alpha)
pairdats.add_column(alphadat)

In [39]:
pairdats


Out[39]:
<Table length=6523551>
ZdeltaZdeltathetaZdeltathetaRalpha
float64float64float64float64float64float64
-0.00150.0010.539116-0.0008090.001286061288690.680007633186
-0.00150.0010.989785-0.0014850.001790046725370.978045564681
-0.0010.0020.984608-0.0009850.00222922697670.457471875897
-0.0010.0020.794663-0.0007950.00215208951570.378203831404
-0.0010.0021.159759-0.001160.0023119344580.525493621222
-0.0010.0020.572174-0.0005720.002080236305390.278644209975
-0.0010.0021.105819-0.0011060.0022853524150.505074247406
-0.0010.0021.998327-0.0019980.00282724438260.784979738416
-0.0010.0022.372919-0.0023730.003103344096380.870471520917
-0.0010.0021.574572-0.0015750.00254544239440.666940281126
..................
3.57550.0050.0035050.012530.01349274692851.19117426594
3.5780.0160.0036390.013020.02062836168480.683081894981
3.57950.0110.0011660.0041750.01176519216370.362646215648
3.5820.0140.0034150.0122320.01859125574570.718122811461
3.58550.0070.0044150.015830.01730862056751.15444874925
3.5960.0160.0020470.007360.01761205546390.431190943163
3.5960.0060.003650.0131240.01443177484441.1420298228
3.5960.00.0029010.0104340.0104319961.57079632679
3.59850.0170.0042210.0151910.02279723398930.729204740345
3.60.0180.003320.0119520.0216067189550.586154176817

In [43]:
om=0.3
ol=0.7
xLCDM=1.0/np.sqrt(om*(1+pairdats['Z'])**3+ol)

In [44]:
xLCDM


Out[44]:
<Column name='Z' dtype='float64' length=6523551>
1.00067467016
1.00067467016
1.00044985352
1.00044985352
1.00044985352
1.00044985352
1.00044985352
1.00044985352
1.00044985352
1.00044985352
1.00044985352
1.00044985352
...
0.184401282435
0.184371769673
0.184312767301
0.184165396292
0.184077066095
0.183930002874
0.18372443672
0.183109985927
0.183109985927
0.183109985927
0.182964183113
0.182876792494

In [42]:
xLCDMdat=pairdats.Column(name='xLCDM',data=xLCDM)
pairdats.add_column(xLCDMdat)
pairdats


Out[42]:
<Table length=6523551>
ZdeltaZdeltathetaZdeltathetaRalphaxLCDM
float64float64float64float64float64float64float64
-0.00150.0010.539116-0.0008090.001286061288690.6800076331861.00067467016
-0.00150.0010.989785-0.0014850.001790046725370.9780455646811.00067467016
-0.0010.0020.984608-0.0009850.00222922697670.4574718758971.00044985352
-0.0010.0020.794663-0.0007950.00215208951570.3782038314041.00044985352
-0.0010.0021.159759-0.001160.0023119344580.5254936212221.00044985352
-0.0010.0020.572174-0.0005720.002080236305390.2786442099751.00044985352
-0.0010.0021.105819-0.0011060.0022853524150.5050742474061.00044985352
-0.0010.0021.998327-0.0019980.00282724438260.7849797384161.00044985352
-0.0010.0022.372919-0.0023730.003103344096380.8704715209171.00044985352
-0.0010.0021.574572-0.0015750.00254544239440.6669402811261.00044985352
.....................
3.57550.0050.0035050.012530.01349274692851.191174265940.184312767301
3.5780.0160.0036390.013020.02062836168480.6830818949810.184165396292
3.57950.0110.0011660.0041750.01176519216370.3626462156480.184077066095
3.5820.0140.0034150.0122320.01859125574570.7181228114610.183930002874
3.58550.0070.0044150.015830.01730862056751.154448749250.18372443672
3.5960.0160.0020470.007360.01761205546390.4311909431630.183109985927
3.5960.0060.003650.0131240.01443177484441.14202982280.183109985927
3.5960.00.0029010.0104340.0104319961.570796326790.183109985927
3.59850.0170.0042210.0151910.02279723398930.7292047403450.182964183113
3.60.0180.003320.0119520.0216067189550.5861541768170.182876792494

In [93]:
yLCDM0=np.sqrt(om*(1+pairdats['Z'])**3+ol)/pairdats['Z']


/Users/rohin/anaconda/lib/python2.7/site-packages/ipykernel/__main__.py:1: RuntimeWarning: divide by zero encountered in divide
  if __name__ == '__main__':

In [94]:
yLCDM0


Out[94]:
<Column name='Z' dtype='float64' length=6523551>
-666.217189807
-666.217189807
-999.550348757
-999.550348757
-999.550348757
-999.550348757
-999.550348757
-999.550348757
-999.550348757
-999.550348757
-999.550348757
-999.550348757
...
1.51733513647
1.517365741
1.51742696705
1.51758013098
1.51767209697
1.51782548603
1.51804046608
1.51868704299
1.51868704299
1.51868704299
1.51884134936
1.51893399917

In [95]:
LCDMf = lambda x: 1.0/math.sqrt(om*(1+x)**3+ol)
np.vectorize(LCDMf)

def LCDMfint(z):
    return integrate.quad(LCDMf, 0, z)

LCDMfint=np.vectorize(LCDMfint)

yLCDM=yLCDM0*LCDMfint(pairdats['Z'])[0]


/Users/rohin/anaconda/lib/python2.7/site-packages/ipykernel/__main__.py:9: RuntimeWarning: invalid value encountered in multiply

In [96]:
yLCDM


Out[96]:
<Column name='Z' dtype='float64' length=6523551>
0.999662947356
0.999662947356
0.9997751988
0.9997751988
0.9997751988
0.9997751988
0.9997751988
0.9997751988
0.9997751988
0.9997751988
0.9997751988
0.9997751988
...
2.4287612342
2.42895011303
2.42932784764
2.43027204961
2.43083847858
2.4317823732
2.43310350314
2.43706463723
2.43706463723
2.43706463723
2.43800726613
2.43857275155

In [98]:
plt.plot(np.log(pairdats['Z']),yLCDM)


/Users/rohin/anaconda/lib/python2.7/site-packages/ipykernel/__main__.py:1: RuntimeWarning: divide by zero encountered in log
  if __name__ == '__main__':
/Users/rohin/anaconda/lib/python2.7/site-packages/ipykernel/__main__.py:1: RuntimeWarning: invalid value encountered in log
  if __name__ == '__main__':
Out[98]:
[<matplotlib.lines.Line2D at 0x11aa02990>]

In [99]:
yLCDMdat=pairdats.Column(name='yLCDM',data=yLCDM)
pairdats.add_column(yLCDMdat)
pairdats


Out[99]:
<Table length=6523551>
ZdeltaZdeltathetaZdeltathetaRalphaxLCDMyLCDM
float64float64float64float64float64float64float64float64
-0.00150.0010.539116-0.0008090.001286061288690.6800076331861.000674670160.999662947356
-0.00150.0010.989785-0.0014850.001790046725370.9780455646811.000674670160.999662947356
-0.0010.0020.984608-0.0009850.00222922697670.4574718758971.000449853520.9997751988
-0.0010.0020.794663-0.0007950.00215208951570.3782038314041.000449853520.9997751988
-0.0010.0021.159759-0.001160.0023119344580.5254936212221.000449853520.9997751988
-0.0010.0020.572174-0.0005720.002080236305390.2786442099751.000449853520.9997751988
-0.0010.0021.105819-0.0011060.0022853524150.5050742474061.000449853520.9997751988
-0.0010.0021.998327-0.0019980.00282724438260.7849797384161.000449853520.9997751988
-0.0010.0022.372919-0.0023730.003103344096380.8704715209171.000449853520.9997751988
-0.0010.0021.574572-0.0015750.00254544239440.6669402811261.000449853520.9997751988
........................
3.57550.0050.0035050.012530.01349274692851.191174265940.1843127673012.42932784764
3.5780.0160.0036390.013020.02062836168480.6830818949810.1841653962922.43027204961
3.57950.0110.0011660.0041750.01176519216370.3626462156480.1840770660952.43083847858
3.5820.0140.0034150.0122320.01859125574570.7181228114610.1839300028742.4317823732
3.58550.0070.0044150.015830.01730862056751.154448749250.183724436722.43310350314
3.5960.0160.0020470.007360.01761205546390.4311909431630.1831099859272.43706463723
3.5960.0060.003650.0131240.01443177484441.14202982280.1831099859272.43706463723
3.5960.00.0029010.0104340.0104319961.570796326790.1831099859272.43706463723
3.59850.0170.0042210.0151910.02279723398930.7292047403450.1829641831132.43800726613
3.60.0180.003320.0119520.0216067189550.5861541768170.1828767924942.43857275155

In [100]:
sLCDM=pairdats['xLCDM']*np.sqrt((pairdats['deltaZ'])**2+(pairdats['yLCDM']*pairdats['Zdeltatheta'])**2)

In [101]:
sLCDMdat=pairdats.Column(name='sLCDM',data=sLCDM)
pairdats.add_column(sLCDMdat)
pairdats


Out[101]:
<Table length=6523551>
ZdeltaZdeltathetaZdeltathetaRalphaxLCDMyLCDMsLCDM
float64float64float64float64float64float64float64float64float64
-0.00150.0010.539116-0.0008090.001286061288690.6800076331861.000674670160.9996629473560.0012869625095
-0.00150.0010.989785-0.0014850.001790046725370.9780455646811.000674670160.9996629473560.00179110666594
-0.0010.0020.984608-0.0009850.00222922697670.4574718758971.000449853520.99977519880.0022303051794
-0.0010.0020.794663-0.0007950.00215208951570.3782038314041.000449853520.99977519880.00215311611837
-0.0010.0021.159759-0.001160.0023119344580.5254936212221.000449853520.99977519880.00231296456834
-0.0010.0020.572174-0.0005720.002080236305390.2786442099751.000449853520.99977519880.00208108886284
-0.0010.0021.105819-0.0011060.0022853524150.5050742474061.000449853520.99977519880.00228634775052
-0.0010.0021.998327-0.0019980.00282724438260.7849797384161.000449853520.99977519880.00282796744178
-0.0010.0022.372919-0.0023730.003103344096380.8704715209171.000449853520.99977519880.00310439404409
-0.0010.0021.574572-0.0015750.00254544239440.6669402811261.000449853520.99977519880.00254663322885
...........................
3.57550.0050.0035050.012530.01349274692851.191174265940.1843127673012.429327847640.00568556885124
3.5780.0160.0036390.013020.02062836168480.6830818949810.1841653962922.430272049610.00653002077534
3.57950.0110.0011660.0041750.01176519216370.3626462156480.1840770660952.430838478580.00275499566675
3.5820.0140.0034150.0122320.01859125574570.7181228114610.1839300028742.43178237320.00604679069142
3.58550.0070.0044150.015830.01730862056751.154448749250.183724436722.433103503140.00719225310651
3.5960.0160.0020470.007360.01761205546390.4311909431630.1831099859272.437064637230.00440122912702
3.5960.0060.003650.0131240.01443177484441.14202982280.1831099859272.437064637230.00595875619834
3.5960.00.0029010.0104340.0104319961.570796326790.1831099859272.437064637230.00465618159246
3.59850.0170.0042210.0151910.02279723398930.7292047403450.1829641831132.438007266130.00745598271651
3.60.0180.003320.0119520.0216067189550.5861541768170.1828767924942.438572751550.00626464175486

In [104]:
ascii.write(pairdats,"./output/sLCDM_correl.dat")

In [105]:
pairdats


Out[105]:
<Table length=6523551>
ZdeltaZdeltathetaZdeltathetaRalphaxLCDMyLCDMsLCDM
float64float64float64float64float64float64float64float64float64
-0.00150.0010.539116-0.0008090.001286061288690.6800076331861.000674670160.9996629473560.0012869625095
-0.00150.0010.989785-0.0014850.001790046725370.9780455646811.000674670160.9996629473560.00179110666594
-0.0010.0020.984608-0.0009850.00222922697670.4574718758971.000449853520.99977519880.0022303051794
-0.0010.0020.794663-0.0007950.00215208951570.3782038314041.000449853520.99977519880.00215311611837
-0.0010.0021.159759-0.001160.0023119344580.5254936212221.000449853520.99977519880.00231296456834
-0.0010.0020.572174-0.0005720.002080236305390.2786442099751.000449853520.99977519880.00208108886284
-0.0010.0021.105819-0.0011060.0022853524150.5050742474061.000449853520.99977519880.00228634775052
-0.0010.0021.998327-0.0019980.00282724438260.7849797384161.000449853520.99977519880.00282796744178
-0.0010.0022.372919-0.0023730.003103344096380.8704715209171.000449853520.99977519880.00310439404409
-0.0010.0021.574572-0.0015750.00254544239440.6669402811261.000449853520.99977519880.00254663322885
...........................
3.57550.0050.0035050.012530.01349274692851.191174265940.1843127673012.429327847640.00568556885124
3.5780.0160.0036390.013020.02062836168480.6830818949810.1841653962922.430272049610.00653002077534
3.57950.0110.0011660.0041750.01176519216370.3626462156480.1840770660952.430838478580.00275499566675
3.5820.0140.0034150.0122320.01859125574570.7181228114610.1839300028742.43178237320.00604679069142
3.58550.0070.0044150.015830.01730862056751.154448749250.183724436722.433103503140.00719225310651
3.5960.0160.0020470.007360.01761205546390.4311909431630.1831099859272.437064637230.00440122912702
3.5960.0060.003650.0131240.01443177484441.14202982280.1831099859272.437064637230.00595875619834
3.5960.00.0029010.0104340.0104319961.570796326790.1831099859272.437064637230.00465618159246
3.59850.0170.0042210.0151910.02279723398930.7292047403450.1829641831132.438007266130.00745598271651
3.60.0180.003320.0119520.0216067189550.5861541768170.1828767924942.438572751550.00626464175486

In [ ]:
spairs_knuth=hist(pairdats['sLCDM'][2253:len(pairdats['sLCDM']-1)],bins='knuth')
spairs_blocks=hist(pairdats['sLCDM'][2253:len(pairdats['sLCDM']-1)],bins='blocks')
DDsk=AutoCorrelation(spairs_knuth[0])
DDsb=AutoCorrelation(spairs_blocks[0])
plt.plot(spairs_knuth[1][1:len(spairs_knuth[1])],DDsk)
plt.savefig("./images/DD_sLCDM_knuth.pdf")
plt.savefig("./images/DD_sLCDM_knuth.jpeg")
plt.plot(spairs_blocks[1][1:len(spairs_blocks[1])],DDsb)
plt.savefig("./images/DD_sLCDM_blocks.pdf")
plt.savefig("./images/DD_sLCDM_blocks.jpeg")

In [129]:
spairs_1000=hist(sLCDM[2253:len(sLCDM)-1],bins=1000)
plt.savefig("./images/hist_sLCDM_1000.pdf")
plt.savefig("./images/hist_sLCDM_1000.jpeg")
DDs1000=AutoCorrelation(spairs_1000[0])
plt.figure()
plt.plot(spairs_1000[1][1:len(spairs_1000[1])],DDs1000)
plt.savefig("./images/DD_sLCDM_1000.pdf")
plt.savefig("./images/DD_sLCDM_1000.jpeg")



In [112]:
max(sLCDM)


Out[112]:
0.028187966602223606

In [114]:
np.all(np.isfinite(sLCDM))


Out[114]:
False

In [115]:
min(sLCDM)


Out[115]:
9.6817160036876236e-07

In [116]:
help(np.isfinite)


Help on ufunc object:

isfinite = class ufunc(__builtin__.object)
 |  Functions that operate element by element on whole arrays.
 |  
 |  To see the documentation for a specific ufunc, use np.info().  For
 |  example, np.info(np.sin).  Because ufuncs are written in C
 |  (for speed) and linked into Python with NumPy's ufunc facility,
 |  Python's help() function finds this page whenever help() is called
 |  on a ufunc.
 |  
 |  A detailed explanation of ufuncs can be found in the "ufuncs.rst"
 |  file in the NumPy reference guide.
 |  
 |  Unary ufuncs:
 |  =============
 |  
 |  op(X, out=None)
 |  Apply op to X elementwise
 |  
 |  Parameters
 |  ----------
 |  X : array_like
 |      Input array.
 |  out : array_like
 |      An array to store the output. Must be the same shape as `X`.
 |  
 |  Returns
 |  -------
 |  r : array_like
 |      `r` will have the same shape as `X`; if out is provided, `r`
 |      will be equal to out.
 |  
 |  Binary ufuncs:
 |  ==============
 |  
 |  op(X, Y, out=None)
 |  Apply `op` to `X` and `Y` elementwise. May "broadcast" to make
 |  the shapes of `X` and `Y` congruent.
 |  
 |  The broadcasting rules are:
 |  
 |  * Dimensions of length 1 may be prepended to either array.
 |  * Arrays may be repeated along dimensions of length 1.
 |  
 |  Parameters
 |  ----------
 |  X : array_like
 |      First input array.
 |  Y : array_like
 |      Second input array.
 |  out : array_like
 |      An array to store the output. Must be the same shape as the
 |      output would have.
 |  
 |  Returns
 |  -------
 |  r : array_like
 |      The return value; if out is provided, `r` will be equal to out.
 |  
 |  Methods defined here:
 |  
 |  __call__(...)
 |      x.__call__(...) <==> x(...)
 |  
 |  __repr__(...)
 |      x.__repr__() <==> repr(x)
 |  
 |  __str__(...)
 |      x.__str__() <==> str(x)
 |  
 |  accumulate(...)
 |      accumulate(array, axis=0, dtype=None, out=None)
 |      
 |      Accumulate the result of applying the operator to all elements.
 |      
 |      For a one-dimensional array, accumulate produces results equivalent to::
 |      
 |        r = np.empty(len(A))
 |        t = op.identity        # op = the ufunc being applied to A's  elements
 |        for i in range(len(A)):
 |            t = op(t, A[i])
 |            r[i] = t
 |        return r
 |      
 |      For example, add.accumulate() is equivalent to np.cumsum().
 |      
 |      For a multi-dimensional array, accumulate is applied along only one
 |      axis (axis zero by default; see Examples below) so repeated use is
 |      necessary if one wants to accumulate over multiple axes.
 |      
 |      Parameters
 |      ----------
 |      array : array_like
 |          The array to act on.
 |      axis : int, optional
 |          The axis along which to apply the accumulation; default is zero.
 |      dtype : data-type code, optional
 |          The data-type used to represent the intermediate results. Defaults
 |          to the data-type of the output array if such is provided, or the
 |          the data-type of the input array if no output array is provided.
 |      out : ndarray, optional
 |          A location into which the result is stored. If not provided a
 |          freshly-allocated array is returned.
 |      
 |      Returns
 |      -------
 |      r : ndarray
 |          The accumulated values. If `out` was supplied, `r` is a reference to
 |          `out`.
 |      
 |      Examples
 |      --------
 |      1-D array examples:
 |      
 |      >>> np.add.accumulate([2, 3, 5])
 |      array([ 2,  5, 10])
 |      >>> np.multiply.accumulate([2, 3, 5])
 |      array([ 2,  6, 30])
 |      
 |      2-D array examples:
 |      
 |      >>> I = np.eye(2)
 |      >>> I
 |      array([[ 1.,  0.],
 |             [ 0.,  1.]])
 |      
 |      Accumulate along axis 0 (rows), down columns:
 |      
 |      >>> np.add.accumulate(I, 0)
 |      array([[ 1.,  0.],
 |             [ 1.,  1.]])
 |      >>> np.add.accumulate(I) # no axis specified = axis zero
 |      array([[ 1.,  0.],
 |             [ 1.,  1.]])
 |      
 |      Accumulate along axis 1 (columns), through rows:
 |      
 |      >>> np.add.accumulate(I, 1)
 |      array([[ 1.,  1.],
 |             [ 0.,  1.]])
 |  
 |  at(...)
 |      at(a, indices, b=None)
 |      
 |      Performs unbuffered in place operation on operand 'a' for elements
 |      specified by 'indices'. For addition ufunc, this method is equivalent to
 |      `a[indices] += b`, except that results are accumulated for elements that
 |      are indexed more than once. For example, `a[[0,0]] += 1` will only
 |      increment the first element once because of buffering, whereas
 |      `add.at(a, [0,0], 1)` will increment the first element twice.
 |      
 |      .. versionadded:: 1.8.0
 |      
 |      Parameters
 |      ----------
 |      a : array_like
 |          The array to perform in place operation on.
 |      indices : array_like or tuple
 |          Array like index object or slice object for indexing into first
 |          operand. If first operand has multiple dimensions, indices can be a
 |          tuple of array like index objects or slice objects.
 |      b : array_like
 |          Second operand for ufuncs requiring two operands. Operand must be
 |          broadcastable over first operand after indexing or slicing.
 |      
 |      Examples
 |      --------
 |      Set items 0 and 1 to their negative values:
 |      
 |      >>> a = np.array([1, 2, 3, 4])
 |      >>> np.negative.at(a, [0, 1])
 |      >>> print(a)
 |      array([-1, -2, 3, 4])
 |      
 |      ::
 |      
 |      Increment items 0 and 1, and increment item 2 twice:
 |      
 |      >>> a = np.array([1, 2, 3, 4])
 |      >>> np.add.at(a, [0, 1, 2, 2], 1)
 |      >>> print(a)
 |      array([2, 3, 5, 4])
 |      
 |      ::
 |      
 |      Add items 0 and 1 in first array to second array,
 |      and store results in first array:
 |      
 |      >>> a = np.array([1, 2, 3, 4])
 |      >>> b = np.array([1, 2])
 |      >>> np.add.at(a, [0, 1], b)
 |      >>> print(a)
 |      array([2, 4, 3, 4])
 |  
 |  outer(...)
 |      outer(A, B)
 |      
 |      Apply the ufunc `op` to all pairs (a, b) with a in `A` and b in `B`.
 |      
 |      Let ``M = A.ndim``, ``N = B.ndim``. Then the result, `C`, of
 |      ``op.outer(A, B)`` is an array of dimension M + N such that:
 |      
 |      .. math:: C[i_0, ..., i_{M-1}, j_0, ..., j_{N-1}] =
 |         op(A[i_0, ..., i_{M-1}], B[j_0, ..., j_{N-1}])
 |      
 |      For `A` and `B` one-dimensional, this is equivalent to::
 |      
 |        r = empty(len(A),len(B))
 |        for i in range(len(A)):
 |            for j in range(len(B)):
 |                r[i,j] = op(A[i], B[j]) # op = ufunc in question
 |      
 |      Parameters
 |      ----------
 |      A : array_like
 |          First array
 |      B : array_like
 |          Second array
 |      
 |      Returns
 |      -------
 |      r : ndarray
 |          Output array
 |      
 |      See Also
 |      --------
 |      numpy.outer
 |      
 |      Examples
 |      --------
 |      >>> np.multiply.outer([1, 2, 3], [4, 5, 6])
 |      array([[ 4,  5,  6],
 |             [ 8, 10, 12],
 |             [12, 15, 18]])
 |      
 |      A multi-dimensional example:
 |      
 |      >>> A = np.array([[1, 2, 3], [4, 5, 6]])
 |      >>> A.shape
 |      (2, 3)
 |      >>> B = np.array([[1, 2, 3, 4]])
 |      >>> B.shape
 |      (1, 4)
 |      >>> C = np.multiply.outer(A, B)
 |      >>> C.shape; C
 |      (2, 3, 1, 4)
 |      array([[[[ 1,  2,  3,  4]],
 |              [[ 2,  4,  6,  8]],
 |              [[ 3,  6,  9, 12]]],
 |             [[[ 4,  8, 12, 16]],
 |              [[ 5, 10, 15, 20]],
 |              [[ 6, 12, 18, 24]]]])
 |  
 |  reduce(...)
 |      reduce(a, axis=0, dtype=None, out=None, keepdims=False)
 |      
 |      Reduces `a`'s dimension by one, by applying ufunc along one axis.
 |      
 |      Let :math:`a.shape = (N_0, ..., N_i, ..., N_{M-1})`.  Then
 |      :math:`ufunc.reduce(a, axis=i)[k_0, ..,k_{i-1}, k_{i+1}, .., k_{M-1}]` =
 |      the result of iterating `j` over :math:`range(N_i)`, cumulatively applying
 |      ufunc to each :math:`a[k_0, ..,k_{i-1}, j, k_{i+1}, .., k_{M-1}]`.
 |      For a one-dimensional array, reduce produces results equivalent to:
 |      ::
 |      
 |       r = op.identity # op = ufunc
 |       for i in range(len(A)):
 |         r = op(r, A[i])
 |       return r
 |      
 |      For example, add.reduce() is equivalent to sum().
 |      
 |      Parameters
 |      ----------
 |      a : array_like
 |          The array to act on.
 |      axis : None or int or tuple of ints, optional
 |          Axis or axes along which a reduction is performed.
 |          The default (`axis` = 0) is perform a reduction over the first
 |          dimension of the input array. `axis` may be negative, in
 |          which case it counts from the last to the first axis.
 |      
 |          .. versionadded:: 1.7.0
 |      
 |          If this is `None`, a reduction is performed over all the axes.
 |          If this is a tuple of ints, a reduction is performed on multiple
 |          axes, instead of a single axis or all the axes as before.
 |      
 |          For operations which are either not commutative or not associative,
 |          doing a reduction over multiple axes is not well-defined. The
 |          ufuncs do not currently raise an exception in this case, but will
 |          likely do so in the future.
 |      dtype : data-type code, optional
 |          The type used to represent the intermediate results. Defaults
 |          to the data-type of the output array if this is provided, or
 |          the data-type of the input array if no output array is provided.
 |      out : ndarray, optional
 |          A location into which the result is stored. If not provided, a
 |          freshly-allocated array is returned.
 |      keepdims : bool, optional
 |          If this is set to True, the axes which are reduced are left
 |          in the result as dimensions with size one. With this option,
 |          the result will broadcast correctly against the original `arr`.
 |      
 |          .. versionadded:: 1.7.0
 |      
 |      Returns
 |      -------
 |      r : ndarray
 |          The reduced array. If `out` was supplied, `r` is a reference to it.
 |      
 |      Examples
 |      --------
 |      >>> np.multiply.reduce([2,3,5])
 |      30
 |      
 |      A multi-dimensional array example:
 |      
 |      >>> X = np.arange(8).reshape((2,2,2))
 |      >>> X
 |      array([[[0, 1],
 |              [2, 3]],
 |             [[4, 5],
 |              [6, 7]]])
 |      >>> np.add.reduce(X, 0)
 |      array([[ 4,  6],
 |             [ 8, 10]])
 |      >>> np.add.reduce(X) # confirm: default axis value is 0
 |      array([[ 4,  6],
 |             [ 8, 10]])
 |      >>> np.add.reduce(X, 1)
 |      array([[ 2,  4],
 |             [10, 12]])
 |      >>> np.add.reduce(X, 2)
 |      array([[ 1,  5],
 |             [ 9, 13]])
 |  
 |  reduceat(...)
 |      reduceat(a, indices, axis=0, dtype=None, out=None)
 |      
 |      Performs a (local) reduce with specified slices over a single axis.
 |      
 |      For i in ``range(len(indices))``, `reduceat` computes
 |      ``ufunc.reduce(a[indices[i]:indices[i+1]])``, which becomes the i-th
 |      generalized "row" parallel to `axis` in the final result (i.e., in a
 |      2-D array, for example, if `axis = 0`, it becomes the i-th row, but if
 |      `axis = 1`, it becomes the i-th column).  There are three exceptions to this:
 |      
 |      * when ``i = len(indices) - 1`` (so for the last index),
 |        ``indices[i+1] = a.shape[axis]``.
 |      * if ``indices[i] >= indices[i + 1]``, the i-th generalized "row" is
 |        simply ``a[indices[i]]``.
 |      * if ``indices[i] >= len(a)`` or ``indices[i] < 0``, an error is raised.
 |      
 |      The shape of the output depends on the size of `indices`, and may be
 |      larger than `a` (this happens if ``len(indices) > a.shape[axis]``).
 |      
 |      Parameters
 |      ----------
 |      a : array_like
 |          The array to act on.
 |      indices : array_like
 |          Paired indices, comma separated (not colon), specifying slices to
 |          reduce.
 |      axis : int, optional
 |          The axis along which to apply the reduceat.
 |      dtype : data-type code, optional
 |          The type used to represent the intermediate results. Defaults
 |          to the data type of the output array if this is provided, or
 |          the data type of the input array if no output array is provided.
 |      out : ndarray, optional
 |          A location into which the result is stored. If not provided a
 |          freshly-allocated array is returned.
 |      
 |      Returns
 |      -------
 |      r : ndarray
 |          The reduced values. If `out` was supplied, `r` is a reference to
 |          `out`.
 |      
 |      Notes
 |      -----
 |      A descriptive example:
 |      
 |      If `a` is 1-D, the function `ufunc.accumulate(a)` is the same as
 |      ``ufunc.reduceat(a, indices)[::2]`` where `indices` is
 |      ``range(len(array) - 1)`` with a zero placed
 |      in every other element:
 |      ``indices = zeros(2 * len(a) - 1)``, ``indices[1::2] = range(1, len(a))``.
 |      
 |      Don't be fooled by this attribute's name: `reduceat(a)` is not
 |      necessarily smaller than `a`.
 |      
 |      Examples
 |      --------
 |      To take the running sum of four successive values:
 |      
 |      >>> np.add.reduceat(np.arange(8),[0,4, 1,5, 2,6, 3,7])[::2]
 |      array([ 6, 10, 14, 18])
 |      
 |      A 2-D example:
 |      
 |      >>> x = np.linspace(0, 15, 16).reshape(4,4)
 |      >>> x
 |      array([[  0.,   1.,   2.,   3.],
 |             [  4.,   5.,   6.,   7.],
 |             [  8.,   9.,  10.,  11.],
 |             [ 12.,  13.,  14.,  15.]])
 |      
 |      ::
 |      
 |       # reduce such that the result has the following five rows:
 |       # [row1 + row2 + row3]
 |       # [row4]
 |       # [row2]
 |       # [row3]
 |       # [row1 + row2 + row3 + row4]
 |      
 |      >>> np.add.reduceat(x, [0, 3, 1, 2, 0])
 |      array([[ 12.,  15.,  18.,  21.],
 |             [ 12.,  13.,  14.,  15.],
 |             [  4.,   5.,   6.,   7.],
 |             [  8.,   9.,  10.,  11.],
 |             [ 24.,  28.,  32.,  36.]])
 |      
 |      ::
 |      
 |       # reduce such that result has the following two columns:
 |       # [col1 * col2 * col3, col4]
 |      
 |      >>> np.multiply.reduceat(x, [0, 3], 1)
 |      array([[    0.,     3.],
 |             [  120.,     7.],
 |             [  720.,    11.],
 |             [ 2184.,    15.]])
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |  
 |  identity
 |      The identity value.
 |      
 |      Data attribute containing the identity element for the ufunc, if it has one.
 |      If it does not, the attribute value is None.
 |      
 |      Examples
 |      --------
 |      >>> np.add.identity
 |      0
 |      >>> np.multiply.identity
 |      1
 |      >>> np.power.identity
 |      1
 |      >>> print(np.exp.identity)
 |      None
 |  
 |  nargs
 |      The number of arguments.
 |      
 |      Data attribute containing the number of arguments the ufunc takes, including
 |      optional ones.
 |      
 |      Notes
 |      -----
 |      Typically this value will be one more than what you might expect because all
 |      ufuncs take  the optional "out" argument.
 |      
 |      Examples
 |      --------
 |      >>> np.add.nargs
 |      3
 |      >>> np.multiply.nargs
 |      3
 |      >>> np.power.nargs
 |      3
 |      >>> np.exp.nargs
 |      2
 |  
 |  nin
 |      The number of inputs.
 |      
 |      Data attribute containing the number of arguments the ufunc treats as input.
 |      
 |      Examples
 |      --------
 |      >>> np.add.nin
 |      2
 |      >>> np.multiply.nin
 |      2
 |      >>> np.power.nin
 |      2
 |      >>> np.exp.nin
 |      1
 |  
 |  nout
 |      The number of outputs.
 |      
 |      Data attribute containing the number of arguments the ufunc treats as output.
 |      
 |      Notes
 |      -----
 |      Since all ufuncs can take output arguments, this will always be (at least) 1.
 |      
 |      Examples
 |      --------
 |      >>> np.add.nout
 |      1
 |      >>> np.multiply.nout
 |      1
 |      >>> np.power.nout
 |      1
 |      >>> np.exp.nout
 |      1
 |  
 |  ntypes
 |      The number of types.
 |      
 |      The number of numerical NumPy types - of which there are 18 total - on which
 |      the ufunc can operate.
 |      
 |      See Also
 |      --------
 |      numpy.ufunc.types
 |      
 |      Examples
 |      --------
 |      >>> np.add.ntypes
 |      18
 |      >>> np.multiply.ntypes
 |      18
 |      >>> np.power.ntypes
 |      17
 |      >>> np.exp.ntypes
 |      7
 |      >>> np.remainder.ntypes
 |      14
 |  
 |  signature
 |  
 |  types
 |      Returns a list with types grouped input->output.
 |      
 |      Data attribute listing the data-type "Domain-Range" groupings the ufunc can
 |      deliver. The data-types are given using the character codes.
 |      
 |      See Also
 |      --------
 |      numpy.ufunc.ntypes
 |      
 |      Examples
 |      --------
 |      >>> np.add.types
 |      ['??->?', 'bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l',
 |      'LL->L', 'qq->q', 'QQ->Q', 'ff->f', 'dd->d', 'gg->g', 'FF->F', 'DD->D',
 |      'GG->G', 'OO->O']
 |      
 |      >>> np.multiply.types
 |      ['??->?', 'bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l',
 |      'LL->L', 'qq->q', 'QQ->Q', 'ff->f', 'dd->d', 'gg->g', 'FF->F', 'DD->D',
 |      'GG->G', 'OO->O']
 |      
 |      >>> np.power.types
 |      ['bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l', 'LL->L',
 |      'qq->q', 'QQ->Q', 'ff->f', 'dd->d', 'gg->g', 'FF->F', 'DD->D', 'GG->G',
 |      'OO->O']
 |      
 |      >>> np.exp.types
 |      ['f->f', 'd->d', 'g->g', 'F->F', 'D->D', 'G->G', 'O->O']
 |      
 |      >>> np.remainder.types
 |      ['bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l', 'LL->L',
 |      'qq->q', 'QQ->Q', 'ff->f', 'dd->d', 'gg->g', 'OO->O']


In [117]:
np.argwhere(np.isnan(sLCDM))


Out[117]:
array([[ 206],
       [ 207],
       [ 208],
       ..., 
       [2250],
       [2251],
       [2252]])

In [119]:
sLCDM[2252]


Out[119]:
nan

In [121]:
pairdats['Z'][2252]


Out[121]:
0.0

In [ ]:
spairs1000=spairs_knuth

In [134]:
plt.figure()
plt.loglog(4.1e3*spairs_1000[1][1:len(spairs_1000[1])],DDs1000)
plt.savefig("./images/DD_sLCDMlog_1000.pdf")
plt.savefig("./images/DD_sLCDMlog_1000.jpeg")



In [135]:
plt.figure()
plt.loglog(4.1e3*spairs_1000[1][1:len(spairs_1000[1])],spairs_1000[1][1:len(spairs_1000[1])]**2*DDs1000)
plt.savefig("./images/DD_sLCDMlog_1000.pdf")
plt.savefig("./images/DD_sLCDMlog_1000.jpeg")



In [48]:
help(hmqdat.MaskedColumn)


Help on class MaskedColumn in module astropy.table.column:

class MaskedColumn(Column, astropy.table._column_mixins._MaskedColumnGetitemShim, numpy.ma.core.MaskedArray)
 |  Define a masked data column for use in a Table object.
 |  
 |  Parameters
 |  ----------
 |  data : list, ndarray or None
 |      Column data values
 |  name : str
 |      Column name and key for reference within Table
 |  mask : list, ndarray or None
 |      Boolean mask for which True indicates missing or invalid data
 |  fill_value : float, int, str or None
 |      Value used when filling masked column elements
 |  dtype : numpy.dtype compatible value
 |      Data type for column
 |  shape : tuple or ()
 |      Dimensions of a single row element in the column data
 |  length : int or 0
 |      Number of row elements in column data
 |  description : str or None
 |      Full description of column
 |  unit : str or None
 |      Physical unit
 |  format : str or None or function or callable
 |      Format string for outputting column values.  This can be an
 |      "old-style" (``format % value``) or "new-style" (`str.format`)
 |      format specification string or a function or any callable object that
 |      accepts a single value and returns a string.
 |  meta : dict-like or None
 |      Meta-data associated with the column
 |  
 |  Examples
 |  --------
 |  A MaskedColumn is similar to a Column except that it includes ``mask`` and
 |  ``fill_value`` attributes.  It can be created in two different ways:
 |  
 |  - Provide a ``data`` value but not ``shape`` or ``length`` (which are
 |    inferred from the data).
 |  
 |    Examples::
 |  
 |      col = MaskedColumn(data=[1, 2], name='name')
 |      col = MaskedColumn(data=[1, 2], name='name', mask=[True, False])
 |      col = MaskedColumn(data=[1, 2], name='name', dtype=float, fill_value=99)
 |  
 |    The ``mask`` argument will be cast as a boolean array and specifies
 |    which elements are considered to be missing or invalid.
 |  
 |    The ``dtype`` argument can be any value which is an acceptable
 |    fixed-size data-type initializer for the numpy.dtype() method.  See
 |    `<http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html>`_.
 |    Examples include:
 |  
 |    - Python non-string type (float, int, bool)
 |    - Numpy non-string type (e.g. np.float32, np.int64, np.bool)
 |    - Numpy.dtype array-protocol type strings (e.g. 'i4', 'f8', 'S15')
 |  
 |    If no ``dtype`` value is provide then the type is inferred using
 |    ``np.array(data)``.  When ``data`` is provided then the ``shape``
 |    and ``length`` arguments are ignored.
 |  
 |  - Provide ``length`` and optionally ``shape``, but not ``data``
 |  
 |    Examples::
 |  
 |      col = MaskedColumn(name='name', length=5)
 |      col = MaskedColumn(name='name', dtype=int, length=10, shape=(3,4))
 |  
 |    The default ``dtype`` is ``np.float64``.  The ``shape`` argument is the
 |    array shape of a single cell in the column.
 |  
 |  Method resolution order:
 |      MaskedColumn
 |      Column
 |      BaseColumn
 |      astropy.table._column_mixins._MaskedColumnGetitemShim
 |      astropy.table._column_mixins._ColumnGetitemShim
 |      numpy.ma.core.MaskedArray
 |      numpy.ndarray
 |      __builtin__.object
 |  
 |  Methods defined here:
 |  
 |  __setitem__(self, index, value)
 |  
 |  __setslice__(self, start, stop, value)
 |  
 |  convert_unit_to(self, new_unit, equivalencies=[])
 |      Converts the values of the column in-place from the current
 |      unit to the given unit.
 |      
 |      To change the unit associated with this column without
 |      actually changing the data values, simply set the ``unit``
 |      property.
 |      
 |      Parameters
 |      ----------
 |      new_unit : str or `astropy.units.UnitBase` instance
 |          The unit to convert to.
 |      
 |      equivalencies : list of equivalence pairs, optional
 |         A list of equivalence pairs to try if the unit are not
 |         directly convertible.  See :ref:`unit_equivalencies`.
 |      
 |      Raises
 |      ------
 |      astropy.units.UnitsError
 |          If units are inconsistent
 |  
 |  copy(self, order=u'C', data=None, copy_data=True)
 |      Return a copy of the current instance.
 |      
 |      If ``data`` is supplied then a view (reference) of ``data`` is used,
 |      and ``copy_data`` is ignored.
 |      
 |      Parameters
 |      ----------
 |      order : {'C', 'F', 'A', 'K'}, optional
 |          Controls the memory layout of the copy. 'C' means C-order,
 |          'F' means F-order, 'A' means 'F' if ``a`` is Fortran contiguous,
 |          'C' otherwise. 'K' means match the layout of ``a`` as closely
 |          as possible. (Note that this function and :func:numpy.copy are very
 |          similar, but have different default values for their order=
 |          arguments.)  Default is 'C'.
 |      data : array, optional
 |          If supplied then use a view of ``data`` instead of the instance
 |          data.  This allows copying the instance attributes and meta.
 |      copy_data : bool, optional
 |          Make a copy of the internal numpy array instead of using a
 |          reference.  Default is True.
 |      
 |      Returns
 |      -------
 |      col : Column or MaskedColumn
 |          Copy of the current column (same type as original)
 |  
 |  filled(self, fill_value=None)
 |      Return a copy of self, with masked values filled with a given value.
 |      
 |      Parameters
 |      ----------
 |      fill_value : scalar; optional
 |          The value to use for invalid entries (`None` by default).  If
 |          `None`, the ``fill_value`` attribute of the array is used
 |          instead.
 |      
 |      Returns
 |      -------
 |      filled_column : Column
 |          A copy of ``self`` with masked entries replaced by `fill_value`
 |          (be it the function argument or the attribute of ``self``).
 |  
 |  insert(self, obj, values, mask=None)
 |      Insert values along the given axis before the given indices and return
 |      a new `~astropy.table.MaskedColumn` object.
 |      
 |      Parameters
 |      ----------
 |      obj : int, slice or sequence of ints
 |          Object that defines the index or indices before which ``values`` is
 |          inserted.
 |      values : array_like
 |          Value(s) to insert.  If the type of ``values`` is different
 |          from that of quantity, ``values`` is converted to the matching type.
 |          ``values`` should be shaped so that it can be broadcast appropriately
 |      mask : boolean array_like
 |          Mask value(s) to insert.  If not supplied then False is used.
 |      
 |      Returns
 |      -------
 |      out : `~astropy.table.MaskedColumn`
 |          A copy of column with ``values`` and ``mask`` inserted.  Note that the
 |          insertion does not occur in-place: a new masked column is returned.
 |  
 |  more(self, max_lines=None, show_name=True, show_unit=False)
 |      Interactively browse column with a paging interface.
 |      
 |      Supported keys::
 |      
 |        f, <space> : forward one page
 |        b : back one page
 |        r : refresh same page
 |        n : next row
 |        p : previous row
 |        < : go to beginning
 |        > : go to end
 |        q : quit browsing
 |        h : print this help
 |      
 |      Parameters
 |      ----------
 |      max_lines : int
 |          Maximum number of lines in table output
 |      
 |      show_name : bool
 |          Include a header row for column names (default=True)
 |      
 |      show_unit : bool
 |          Include a header row for unit (default=False)
 |  
 |  pformat(self, max_lines=None, show_name=True, show_unit=False, show_dtype=False, html=False)
 |      Return a list of formatted string representation of column values.
 |      
 |      If no value of ``max_lines`` is supplied then the height of the
 |      screen terminal is used to set ``max_lines``.  If the terminal
 |      height cannot be determined then the default will be
 |      determined using the ``astropy.conf.max_lines`` configuration
 |      item. If a negative value of ``max_lines`` is supplied then
 |      there is no line limit applied.
 |      
 |      Parameters
 |      ----------
 |      max_lines : int
 |          Maximum lines of output (header + data rows)
 |      
 |      show_name : bool
 |          Include column name (default=True)
 |      
 |      show_unit : bool
 |          Include a header row for unit (default=False)
 |      
 |      show_dtype : bool
 |          Include column dtype (default=False)
 |      
 |      html : bool
 |          Format the output as an HTML table (default=False)
 |      
 |      Returns
 |      -------
 |      lines : list
 |          List of lines with header and formatted column values
 |  
 |  pprint(self, max_lines=None, show_name=True, show_unit=False, show_dtype=False)
 |      Print a formatted string representation of column values.
 |      
 |      If no value of ``max_lines`` is supplied then the height of the
 |      screen terminal is used to set ``max_lines``.  If the terminal
 |      height cannot be determined then the default will be
 |      determined using the ``astropy.conf.max_lines`` configuration
 |      item. If a negative value of ``max_lines`` is supplied then
 |      there is no line limit applied.
 |      
 |      Parameters
 |      ----------
 |      max_lines : int
 |          Maximum number of values in output
 |      
 |      show_name : bool
 |          Include column name (default=True)
 |      
 |      show_unit : bool
 |          Include a header row for unit (default=False)
 |      
 |      show_dtype : bool
 |          Include column dtype (default=True)
 |  
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |  
 |  __new__(cls, data=None, name=None, mask=None, fill_value=None, dtype=None, shape=(), length=0, description=None, unit=None, format=None, meta=None, copy=False, copy_indices=True)
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |  
 |  data
 |  
 |  fill_value
 |  
 |  name
 |      The name of this column.
 |  
 |  ----------------------------------------------------------------------
 |  Methods inherited from Column:
 |  
 |  __bytes__(self)
 |  
 |  __repr__(self)
 |  
 |  __setattr__(self, item, value)
 |  
 |  __str__ = __bytes__(self)
 |  
 |  __unicode__(self)
 |  
 |  to(self, unit, equivalencies=[], **kwargs)
 |      Converts this table column to a `~astropy.units.Quantity` object with
 |      the requested units.
 |      
 |      Parameters
 |      ----------
 |      unit : `~astropy.units.Unit` or str
 |          The unit to convert to (i.e., a valid argument to the
 |          :meth:`astropy.units.Quantity.to` method).
 |      equivalencies : list of equivalence pairs, optional
 |          Equivalencies to use for this conversion.  See
 |          :meth:`astropy.units.Quantity.to` for more details.
 |      
 |      Returns
 |      -------
 |      quantity : `~astropy.units.Quantity`
 |          A quantity object with the contents of this column in the units
 |          ``unit``.
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from Column:
 |  
 |  quantity
 |      A view of this table column as a `~astropy.units.Quantity` object with
 |      units given by the Column's `unit` parameter.
 |  
 |  unit
 |      The unit associated with this column.  May be a string or a
 |      `astropy.units.UnitBase` instance.
 |      
 |      Setting the ``unit`` property does not change the values of the
 |      data.  To perform a unit conversion, use ``convert_unit_to``.
 |  
 |  ----------------------------------------------------------------------
 |  Methods inherited from BaseColumn:
 |  
 |  __array_finalize__(self, obj)
 |  
 |  __array_wrap__(self, out_arr, context=None)
 |      __array_wrap__ is called at the end of every ufunc.
 |      
 |      Normally, we want a Column object back and do not have to do anything
 |      special. But there are two exceptions:
 |      
 |      1) If the output shape is different (e.g. for reduction ufuncs
 |         like sum() or mean()), a Column still linking to a parent_table
 |         makes little sense, so we return the output viewed as the
 |         column content (ndarray or MaskedArray).
 |         For this case, we use "[()]" to select everything, and to ensure we
 |         convert a zero rank array to a scalar. (For some reason np.sum()
 |         returns a zero rank scalar array while np.mean() returns a scalar;
 |         So the [()] is needed for this case.
 |      
 |      2) When the output is created by any function that returns a boolean
 |         we also want to consistently return an array rather than a column
 |         (see #1446 and #1685)
 |  
 |  __eq__(self, other)
 |      # avoid == and != to be done based on type of subclass
 |      # (helped solve #1446; see also __array_wrap__)
 |  
 |  __ne__(self, other)
 |  
 |  __reduce__(self)
 |      Return a 3-tuple for pickling a Column.  Use the super-class
 |      functionality but then add in a 5-tuple of Column-specific values
 |      that get used in __setstate__.
 |  
 |  __setstate__(self, state)
 |      Restore the internal state of the Column/MaskedColumn for pickling
 |      purposes.  This requires that the last element of ``state`` is a
 |      5-tuple that has Column-specific state values.
 |  
 |  attrs_equal(self, col)
 |      Compare the column attributes of ``col`` to this object.
 |      
 |      The comparison attributes are: ``name``, ``unit``, ``dtype``,
 |      ``format``, ``description``, and ``meta``.
 |      
 |      Parameters
 |      ----------
 |      col : Column
 |          Comparison column
 |      
 |      Returns
 |      -------
 |      equal : boolean
 |          True if all attributes are equal
 |  
 |  group_by(self, keys)
 |      Group this column by the specified ``keys``
 |      
 |      This effectively splits the column into groups which correspond to
 |      unique values of the ``keys`` grouping object.  The output is a new
 |      `Column` or `MaskedColumn` which contains a copy of this column but
 |      sorted by row according to ``keys``.
 |      
 |      The ``keys`` input to ``group_by`` must be a numpy array with the
 |      same length as this column.
 |      
 |      Parameters
 |      ----------
 |      keys : numpy array
 |          Key grouping object
 |      
 |      Returns
 |      -------
 |      out : Column
 |          New column with groups attribute set accordingly
 |  
 |  iter_str_vals(self)
 |      Return an iterator that yields the string-formatted values of this
 |      column.
 |      
 |      Returns
 |      -------
 |      str_vals : iterator
 |          Column values formatted as strings
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from BaseColumn:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  descr
 |      Array-interface compliant full description of the column.
 |      
 |      This returns a 3-tuple (name, type, shape) that can always be
 |      used in a structured array dtype definition.
 |  
 |  groups
 |  
 |  info
 |  
 |  meta
 |  
 |  parent_table
 |  
 |  ----------------------------------------------------------------------
 |  Methods inherited from astropy.table._column_mixins._MaskedColumnGetitemShim:
 |  
 |  __getitem__(...)
 |      x.__getitem__(y) <==> x[y]
 |  
 |  ----------------------------------------------------------------------
 |  Methods inherited from numpy.ma.core.MaskedArray:
 |  
 |  __add__(self, other)
 |      Add self to other, and return a new masked array.
 |  
 |  __deepcopy__(self, memo=None)
 |  
 |  __div__(self, other)
 |      Divide other into self, and return a new masked array.
 |  
 |  __float__(self)
 |      Convert to float.
 |  
 |  __floordiv__(self, other)
 |      Divide other into self, and return a new masked array.
 |  
 |  __getslice__(self, i, j)
 |      x.__getslice__(i, j) <==> x[i:j]
 |      
 |      Return the slice described by (i, j).  The use of negative indices
 |      is not supported.
 |  
 |  __getstate__(self)
 |      Return the internal state of the masked array, for pickling
 |      purposes.
 |  
 |  __iadd__(self, other)
 |      Add other to self in-place.
 |  
 |  __idiv__(self, other)
 |      Divide self by other in-place.
 |  
 |  __ifloordiv__(self, other)
 |      Floor divide self by other in-place.
 |  
 |  __imul__(self, other)
 |      Multiply self by other in-place.
 |  
 |  __int__(self)
 |      Convert to int.
 |  
 |  __ipow__(self, other)
 |      Raise self to the power other, in place.
 |  
 |  __isub__(self, other)
 |      Subtract other from self in-place.
 |  
 |  __itruediv__(self, other)
 |      True divide self by other in-place.
 |  
 |  __mul__(self, other)
 |      Multiply self by other, and return a new masked array.
 |  
 |  __pow__(self, other)
 |      Raise self to the power other, masking the potential NaNs/Infs
 |  
 |  __radd__(self, other)
 |      Add other to self, and return a new masked array.
 |  
 |  __rfloordiv__(self, other)
 |      Divide self into other, and return a new masked array.
 |  
 |  __rmul__(self, other)
 |      Multiply other by self, and return a new masked array.
 |  
 |  __rpow__(self, other)
 |      Raise other to the power self, masking the potential NaNs/Infs
 |  
 |  __rsub__(self, other)
 |      Subtract self from other, and return a new masked array.
 |  
 |  __rtruediv__(self, other)
 |      Divide self into other, and return a new masked array.
 |  
 |  __setmask__(self, mask, copy=False)
 |      Set the mask.
 |  
 |  __sub__(self, other)
 |      Subtract other from self, and return a new masked array.
 |  
 |  __truediv__(self, other)
 |      Divide other into self, and return a new masked array.
 |  
 |  all(self, axis=None, out=None, keepdims=<class numpy._globals._NoValue>)
 |      Returns True if all elements evaluate to True.
 |      
 |      The output array is masked where all the values along the given axis
 |      are masked: if the output would have been a scalar and that all the
 |      values are masked, then the output is `masked`.
 |      
 |      Refer to `numpy.all` for full documentation.
 |      
 |      See Also
 |      --------
 |      ndarray.all : corresponding function for ndarrays
 |      numpy.all : equivalent function
 |      
 |      Examples
 |      --------
 |      >>> np.ma.array([1,2,3]).all()
 |      True
 |      >>> a = np.ma.array([1,2,3], mask=True)
 |      >>> (a.all() is np.ma.masked)
 |      True
 |  
 |  anom(self, axis=None, dtype=None)
 |      Compute the anomalies (deviations from the arithmetic mean)
 |      along the given axis.
 |      
 |      Returns an array of anomalies, with the same shape as the input and
 |      where the arithmetic mean is computed along the given axis.
 |      
 |      Parameters
 |      ----------
 |      axis : int, optional
 |          Axis over which the anomalies are taken.
 |          The default is to use the mean of the flattened array as reference.
 |      dtype : dtype, optional
 |          Type to use in computing the variance. For arrays of integer type
 |           the default is float32; for arrays of float types it is the same as
 |           the array type.
 |      
 |      See Also
 |      --------
 |      mean : Compute the mean of the array.
 |      
 |      Examples
 |      --------
 |      >>> a = np.ma.array([1,2,3])
 |      >>> a.anom()
 |      masked_array(data = [-1.  0.  1.],
 |                   mask = False,
 |             fill_value = 1e+20)
 |  
 |  any(self, axis=None, out=None, keepdims=<class numpy._globals._NoValue>)
 |      Returns True if any of the elements of `a` evaluate to True.
 |      
 |      Masked values are considered as False during computation.
 |      
 |      Refer to `numpy.any` for full documentation.
 |      
 |      See Also
 |      --------
 |      ndarray.any : corresponding function for ndarrays
 |      numpy.any : equivalent function
 |  
 |  argmax(self, axis=None, fill_value=None, out=None)
 |      Returns array of indices of the maximum values along the given axis.
 |      Masked values are treated as if they had the value fill_value.
 |      
 |      Parameters
 |      ----------
 |      axis : {None, integer}
 |          If None, the index is into the flattened array, otherwise along
 |          the specified axis
 |      fill_value : {var}, optional
 |          Value used to fill in the masked values.  If None, the output of
 |          maximum_fill_value(self._data) is used instead.
 |      out : {None, array}, optional
 |          Array into which the result can be placed. Its type is preserved
 |          and it must be of the right shape to hold the output.
 |      
 |      Returns
 |      -------
 |      index_array : {integer_array}
 |      
 |      Examples
 |      --------
 |      >>> a = np.arange(6).reshape(2,3)
 |      >>> a.argmax()
 |      5
 |      >>> a.argmax(0)
 |      array([1, 1, 1])
 |      >>> a.argmax(1)
 |      array([2, 2])
 |  
 |  argmin(self, axis=None, fill_value=None, out=None)
 |      Return array of indices to the minimum values along the given axis.
 |      
 |      Parameters
 |      ----------
 |      axis : {None, integer}
 |          If None, the index is into the flattened array, otherwise along
 |          the specified axis
 |      fill_value : {var}, optional
 |          Value used to fill in the masked values.  If None, the output of
 |          minimum_fill_value(self._data) is used instead.
 |      out : {None, array}, optional
 |          Array into which the result can be placed. Its type is preserved
 |          and it must be of the right shape to hold the output.
 |      
 |      Returns
 |      -------
 |      ndarray or scalar
 |          If multi-dimension input, returns a new ndarray of indices to the
 |          minimum values along the given axis.  Otherwise, returns a scalar
 |          of index to the minimum values along the given axis.
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array(arange(4), mask=[1,1,0,0])
 |      >>> x.shape = (2,2)
 |      >>> print(x)
 |      [[-- --]
 |       [2 3]]
 |      >>> print(x.argmin(axis=0, fill_value=-1))
 |      [0 0]
 |      >>> print(x.argmin(axis=0, fill_value=9))
 |      [1 1]
 |  
 |  argsort(self, axis=None, kind='quicksort', order=None, fill_value=None)
 |      Return an ndarray of indices that sort the array along the
 |      specified axis.  Masked values are filled beforehand to
 |      `fill_value`.
 |      
 |      Parameters
 |      ----------
 |      axis : int, optional
 |          Axis along which to sort.  The default is -1 (last axis).
 |          If None, the flattened array is used.
 |      fill_value : var, optional
 |          Value used to fill the array before sorting.
 |          The default is the `fill_value` attribute of the input array.
 |      kind : {'quicksort', 'mergesort', 'heapsort'}, optional
 |          Sorting algorithm.
 |      order : list, optional
 |          When `a` is an array with fields defined, this argument specifies
 |          which fields to compare first, second, etc.  Not all fields need be
 |          specified.
 |      
 |      Returns
 |      -------
 |      index_array : ndarray, int
 |          Array of indices that sort `a` along the specified axis.
 |          In other words, ``a[index_array]`` yields a sorted `a`.
 |      
 |      See Also
 |      --------
 |      sort : Describes sorting algorithms used.
 |      lexsort : Indirect stable sort with multiple keys.
 |      ndarray.sort : Inplace sort.
 |      
 |      Notes
 |      -----
 |      See `sort` for notes on the different sorting algorithms.
 |      
 |      Examples
 |      --------
 |      >>> a = np.ma.array([3,2,1], mask=[False, False, True])
 |      >>> a
 |      masked_array(data = [3 2 --],
 |                   mask = [False False  True],
 |             fill_value = 999999)
 |      >>> a.argsort()
 |      array([1, 0, 2])
 |  
 |  astype(self, newtype)
 |      Returns a copy of the MaskedArray cast to given newtype.
 |      
 |      Returns
 |      -------
 |      output : MaskedArray
 |          A copy of self cast to input newtype.
 |          The returned record shape matches self.shape.
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([[1,2,3.1],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
 |      >>> print(x)
 |      [[1.0 -- 3.1]
 |       [-- 5.0 --]
 |       [7.0 -- 9.0]]
 |      >>> print(x.astype(int32))
 |      [[1 -- 3]
 |       [-- 5 --]
 |       [7 -- 9]]
 |  
 |  clip(self, *args, **params)
 |      a.clip(min=None, max=None, out=None)
 |      
 |      Return an array whose values are limited to ``[min, max]``.
 |      One of max or min must be given.
 |      
 |      Refer to `numpy.clip` for full documentation.
 |      
 |      See Also
 |      --------
 |      numpy.clip : equivalent function
 |  
 |  compress(self, condition, axis=None, out=None)
 |      Return `a` where condition is ``True``.
 |      
 |      If condition is a `MaskedArray`, missing values are considered
 |      as ``False``.
 |      
 |      Parameters
 |      ----------
 |      condition : var
 |          Boolean 1-d array selecting which entries to return. If len(condition)
 |          is less than the size of a along the axis, then output is truncated
 |          to length of condition array.
 |      axis : {None, int}, optional
 |          Axis along which the operation must be performed.
 |      out : {None, ndarray}, optional
 |          Alternative output array in which to place the result. It must have
 |          the same shape as the expected output but the type will be cast if
 |          necessary.
 |      
 |      Returns
 |      -------
 |      result : MaskedArray
 |          A :class:`MaskedArray` object.
 |      
 |      Notes
 |      -----
 |      Please note the difference with :meth:`compressed` !
 |      The output of :meth:`compress` has a mask, the output of
 |      :meth:`compressed` does not.
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
 |      >>> print(x)
 |      [[1 -- 3]
 |       [-- 5 --]
 |       [7 -- 9]]
 |      >>> x.compress([1, 0, 1])
 |      masked_array(data = [1 3],
 |            mask = [False False],
 |            fill_value=999999)
 |      
 |      >>> x.compress([1, 0, 1], axis=1)
 |      masked_array(data =
 |       [[1 3]
 |       [-- --]
 |       [7 9]],
 |            mask =
 |       [[False False]
 |       [ True  True]
 |       [False False]],
 |            fill_value=999999)
 |  
 |  compressed(self)
 |      Return all the non-masked data as a 1-D array.
 |      
 |      Returns
 |      -------
 |      data : ndarray
 |          A new `ndarray` holding the non-masked data is returned.
 |      
 |      Notes
 |      -----
 |      The result is **not** a MaskedArray!
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array(np.arange(5), mask=[0]*2 + [1]*3)
 |      >>> x.compressed()
 |      array([0, 1])
 |      >>> type(x.compressed())
 |      <type 'numpy.ndarray'>
 |  
 |  count(self, axis=None, keepdims=<class numpy._globals._NoValue>)
 |      Count the non-masked elements of the array along the given axis.
 |      
 |      Parameters
 |      ----------
 |      axis : None or int or tuple of ints, optional
 |          Axis or axes along which the count is performed.
 |          The default (`axis` = `None`) performs the count over all
 |          the dimensions of the input array. `axis` may be negative, in
 |          which case it counts from the last to the first axis.
 |      
 |          .. versionadded:: 1.10.0
 |      
 |          If this is a tuple of ints, the count is performed on multiple
 |          axes, instead of a single axis or all the axes as before.
 |      keepdims : bool, optional
 |          If this is set to True, the axes which are reduced are left
 |          in the result as dimensions with size one. With this option,
 |          the result will broadcast correctly against the array.
 |      
 |      Returns
 |      -------
 |      result : ndarray or scalar
 |          An array with the same shape as the input array, with the specified
 |          axis removed. If the array is a 0-d array, or if `axis` is None, a
 |          scalar is returned.
 |      
 |      See Also
 |      --------
 |      count_masked : Count masked elements in array or along a given axis.
 |      
 |      Examples
 |      --------
 |      >>> import numpy.ma as ma
 |      >>> a = ma.arange(6).reshape((2, 3))
 |      >>> a[1, :] = ma.masked
 |      >>> a
 |      masked_array(data =
 |       [[0 1 2]
 |       [-- -- --]],
 |                   mask =
 |       [[False False False]
 |       [ True  True  True]],
 |             fill_value = 999999)
 |      >>> a.count()
 |      3
 |      
 |      When the `axis` keyword is specified an array of appropriate size is
 |      returned.
 |      
 |      >>> a.count(axis=0)
 |      array([1, 1, 1])
 |      >>> a.count(axis=1)
 |      array([3, 0])
 |  
 |  cumprod(self, axis=None, dtype=None, out=None)
 |      Return the cumulative product of the array elements over the given axis.
 |      
 |      Masked values are set to 1 internally during the computation.
 |      However, their position is saved, and the result will be masked at
 |      the same locations.
 |      
 |      Refer to `numpy.cumprod` for full documentation.
 |      
 |      Notes
 |      -----
 |      The mask is lost if `out` is not a valid MaskedArray !
 |      
 |      Arithmetic is modular when using integer types, and no error is
 |      raised on overflow.
 |      
 |      See Also
 |      --------
 |      ndarray.cumprod : corresponding function for ndarrays
 |      numpy.cumprod : equivalent function
 |  
 |  cumsum(self, axis=None, dtype=None, out=None)
 |      Return the cumulative sum of the array elements over the given axis.
 |      
 |      Masked values are set to 0 internally during the computation.
 |      However, their position is saved, and the result will be masked at
 |      the same locations.
 |      
 |      Refer to `numpy.cumsum` for full documentation.
 |      
 |      Notes
 |      -----
 |      The mask is lost if `out` is not a valid :class:`MaskedArray` !
 |      
 |      Arithmetic is modular when using integer types, and no error is
 |      raised on overflow.
 |      
 |      See Also
 |      --------
 |      ndarray.cumsum : corresponding function for ndarrays
 |      numpy.cumsum : equivalent function
 |      
 |      Examples
 |      --------
 |      >>> marr = np.ma.array(np.arange(10), mask=[0,0,0,1,1,1,0,0,0,0])
 |      >>> print(marr.cumsum())
 |      [0 1 3 -- -- -- 9 16 24 33]
 |  
 |  diagonal(self, *args, **params)
 |      a.diagonal(offset=0, axis1=0, axis2=1)
 |      
 |      Return specified diagonals. In NumPy 1.9 the returned array is a
 |      read-only view instead of a copy as in previous NumPy versions.  In
 |      a future version the read-only restriction will be removed.
 |      
 |      Refer to :func:`numpy.diagonal` for full documentation.
 |      
 |      See Also
 |      --------
 |      numpy.diagonal : equivalent function
 |  
 |  dot(self, b, out=None, strict=False)
 |      a.dot(b, out=None)
 |      
 |      Masked dot product of two arrays. Note that `out` and `strict` are
 |      located in different positions than in `ma.dot`. In order to
 |      maintain compatibility with the functional version, it is
 |      recommended that the optional arguments be treated as keyword only.
 |      At some point that may be mandatory.
 |      
 |      .. versionadded:: 1.10.0
 |      
 |      Parameters
 |      ----------
 |      b : masked_array_like
 |          Inputs array.
 |      out : masked_array, optional
 |          Output argument. This must have the exact kind that would be
 |          returned if it was not used. In particular, it must have the
 |          right type, must be C-contiguous, and its dtype must be the
 |          dtype that would be returned for `ma.dot(a,b)`. This is a
 |          performance feature. Therefore, if these conditions are not
 |          met, an exception is raised, instead of attempting to be
 |          flexible.
 |      strict : bool, optional
 |          Whether masked data are propagated (True) or set to 0 (False)
 |          for the computation. Default is False.  Propagating the mask
 |          means that if a masked value appears in a row or column, the
 |          whole row or column is considered masked.
 |      
 |          .. versionadded:: 1.10.2
 |      
 |      See Also
 |      --------
 |      numpy.ma.dot : equivalent function
 |  
 |  flatten(self, *args, **params)
 |      a.flatten(order='C')
 |      
 |      Return a copy of the array collapsed into one dimension.
 |      
 |      Parameters
 |      ----------
 |      order : {'C', 'F', 'A', 'K'}, optional
 |          'C' means to flatten in row-major (C-style) order.
 |          'F' means to flatten in column-major (Fortran-
 |          style) order. 'A' means to flatten in column-major
 |          order if `a` is Fortran *contiguous* in memory,
 |          row-major order otherwise. 'K' means to flatten
 |          `a` in the order the elements occur in memory.
 |          The default is 'C'.
 |      
 |      Returns
 |      -------
 |      y : ndarray
 |          A copy of the input array, flattened to one dimension.
 |      
 |      See Also
 |      --------
 |      ravel : Return a flattened array.
 |      flat : A 1-D flat iterator over the array.
 |      
 |      Examples
 |      --------
 |      >>> a = np.array([[1,2], [3,4]])
 |      >>> a.flatten()
 |      array([1, 2, 3, 4])
 |      >>> a.flatten('F')
 |      array([1, 3, 2, 4])
 |  
 |  get_fill_value(self)
 |      Return the filling value of the masked array.
 |      
 |      Returns
 |      -------
 |      fill_value : scalar
 |          The filling value.
 |      
 |      Examples
 |      --------
 |      >>> for dt in [np.int32, np.int64, np.float64, np.complex128]:
 |      ...     np.ma.array([0, 1], dtype=dt).get_fill_value()
 |      ...
 |      999999
 |      999999
 |      1e+20
 |      (1e+20+0j)
 |      
 |      >>> x = np.ma.array([0, 1.], fill_value=-np.inf)
 |      >>> x.get_fill_value()
 |      -inf
 |  
 |  get_imag(self)
 |      Return the imaginary part of the masked array.
 |      
 |      The returned array is a view on the imaginary part of the `MaskedArray`
 |      whose `get_imag` method is called.
 |      
 |      Parameters
 |      ----------
 |      None
 |      
 |      Returns
 |      -------
 |      result : MaskedArray
 |          The imaginary part of the masked array.
 |      
 |      See Also
 |      --------
 |      get_real, real, imag
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([1+1.j, -2j, 3.45+1.6j], mask=[False, True, False])
 |      >>> x.get_imag()
 |      masked_array(data = [1.0 -- 1.6],
 |                   mask = [False  True False],
 |             fill_value = 1e+20)
 |  
 |  get_real(self)
 |      Return the real part of the masked array.
 |      
 |      The returned array is a view on the real part of the `MaskedArray`
 |      whose `get_real` method is called.
 |      
 |      Parameters
 |      ----------
 |      None
 |      
 |      Returns
 |      -------
 |      result : MaskedArray
 |          The real part of the masked array.
 |      
 |      See Also
 |      --------
 |      get_imag, real, imag
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([1+1.j, -2j, 3.45+1.6j], mask=[False, True, False])
 |      >>> x.get_real()
 |      masked_array(data = [1.0 -- 3.45],
 |                   mask = [False  True False],
 |             fill_value = 1e+20)
 |  
 |  harden_mask(self)
 |      Force the mask to hard.
 |      
 |      Whether the mask of a masked array is hard or soft is determined by
 |      its `hardmask` property. `harden_mask` sets `hardmask` to True.
 |      
 |      See Also
 |      --------
 |      hardmask
 |  
 |  ids(self)
 |      Return the addresses of the data and mask areas.
 |      
 |      Parameters
 |      ----------
 |      None
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([1, 2, 3], mask=[0, 1, 1])
 |      >>> x.ids()
 |      (166670640, 166659832)
 |      
 |      If the array has no mask, the address of `nomask` is returned. This address
 |      is typically not close to the data in memory:
 |      
 |      >>> x = np.ma.array([1, 2, 3])
 |      >>> x.ids()
 |      (166691080, 3083169284L)
 |  
 |  iscontiguous(self)
 |      Return a boolean indicating whether the data is contiguous.
 |      
 |      Parameters
 |      ----------
 |      None
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([1, 2, 3])
 |      >>> x.iscontiguous()
 |      True
 |      
 |      `iscontiguous` returns one of the flags of the masked array:
 |      
 |      >>> x.flags
 |        C_CONTIGUOUS : True
 |        F_CONTIGUOUS : True
 |        OWNDATA : False
 |        WRITEABLE : True
 |        ALIGNED : True
 |        UPDATEIFCOPY : False
 |  
 |  max(self, axis=None, out=None, fill_value=None, keepdims=<class numpy._globals._NoValue>)
 |      Return the maximum along a given axis.
 |      
 |      Parameters
 |      ----------
 |      axis : {None, int}, optional
 |          Axis along which to operate.  By default, ``axis`` is None and the
 |          flattened input is used.
 |      out : array_like, optional
 |          Alternative output array in which to place the result.  Must
 |          be of the same shape and buffer length as the expected output.
 |      fill_value : {var}, optional
 |          Value used to fill in the masked values.
 |          If None, use the output of maximum_fill_value().
 |      
 |      Returns
 |      -------
 |      amax : array_like
 |          New array holding the result.
 |          If ``out`` was specified, ``out`` is returned.
 |      
 |      See Also
 |      --------
 |      maximum_fill_value
 |          Returns the maximum filling value for a given datatype.
 |  
 |  mean(self, axis=None, dtype=None, out=None, keepdims=<class numpy._globals._NoValue>)
 |      Returns the average of the array elements along given axis.
 |      
 |      Masked entries are ignored, and result elements which are not
 |      finite will be masked.
 |      
 |      Refer to `numpy.mean` for full documentation.
 |      
 |      See Also
 |      --------
 |      ndarray.mean : corresponding function for ndarrays
 |      numpy.mean : Equivalent function
 |      numpy.ma.average: Weighted average.
 |      
 |      Examples
 |      --------
 |      >>> a = np.ma.array([1,2,3], mask=[False, False, True])
 |      >>> a
 |      masked_array(data = [1 2 --],
 |                   mask = [False False  True],
 |             fill_value = 999999)
 |      >>> a.mean()
 |      1.5
 |  
 |  min(self, axis=None, out=None, fill_value=None, keepdims=<class numpy._globals._NoValue>)
 |      Return the minimum along a given axis.
 |      
 |      Parameters
 |      ----------
 |      axis : {None, int}, optional
 |          Axis along which to operate.  By default, ``axis`` is None and the
 |          flattened input is used.
 |      out : array_like, optional
 |          Alternative output array in which to place the result.  Must be of
 |          the same shape and buffer length as the expected output.
 |      fill_value : {var}, optional
 |          Value used to fill in the masked values.
 |          If None, use the output of `minimum_fill_value`.
 |      
 |      Returns
 |      -------
 |      amin : array_like
 |          New array holding the result.
 |          If ``out`` was specified, ``out`` is returned.
 |      
 |      See Also
 |      --------
 |      minimum_fill_value
 |          Returns the minimum filling value for a given datatype.
 |  
 |  mini(self, axis=None)
 |      Return the array minimum along the specified axis.
 |      
 |      Parameters
 |      ----------
 |      axis : int, optional
 |          The axis along which to find the minima. Default is None, in which case
 |          the minimum value in the whole array is returned.
 |      
 |      Returns
 |      -------
 |      min : scalar or MaskedArray
 |          If `axis` is None, the result is a scalar. Otherwise, if `axis` is
 |          given and the array is at least 2-D, the result is a masked array with
 |          dimension one smaller than the array on which `mini` is called.
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array(np.arange(6), mask=[0 ,1, 0, 0, 0 ,1]).reshape(3, 2)
 |      >>> print(x)
 |      [[0 --]
 |       [2 3]
 |       [4 --]]
 |      >>> x.mini()
 |      0
 |      >>> x.mini(axis=0)
 |      masked_array(data = [0 3],
 |                   mask = [False False],
 |             fill_value = 999999)
 |      >>> print(x.mini(axis=1))
 |      [0 2 4]
 |  
 |  nonzero(self)
 |      Return the indices of unmasked elements that are not zero.
 |      
 |      Returns a tuple of arrays, one for each dimension, containing the
 |      indices of the non-zero elements in that dimension. The corresponding
 |      non-zero values can be obtained with::
 |      
 |          a[a.nonzero()]
 |      
 |      To group the indices by element, rather than dimension, use
 |      instead::
 |      
 |          np.transpose(a.nonzero())
 |      
 |      The result of this is always a 2d array, with a row for each non-zero
 |      element.
 |      
 |      Parameters
 |      ----------
 |      None
 |      
 |      Returns
 |      -------
 |      tuple_of_arrays : tuple
 |          Indices of elements that are non-zero.
 |      
 |      See Also
 |      --------
 |      numpy.nonzero :
 |          Function operating on ndarrays.
 |      flatnonzero :
 |          Return indices that are non-zero in the flattened version of the input
 |          array.
 |      ndarray.nonzero :
 |          Equivalent ndarray method.
 |      count_nonzero :
 |          Counts the number of non-zero elements in the input array.
 |      
 |      Examples
 |      --------
 |      >>> import numpy.ma as ma
 |      >>> x = ma.array(np.eye(3))
 |      >>> x
 |      masked_array(data =
 |       [[ 1.  0.  0.]
 |       [ 0.  1.  0.]
 |       [ 0.  0.  1.]],
 |            mask =
 |       False,
 |            fill_value=1e+20)
 |      >>> x.nonzero()
 |      (array([0, 1, 2]), array([0, 1, 2]))
 |      
 |      Masked elements are ignored.
 |      
 |      >>> x[1, 1] = ma.masked
 |      >>> x
 |      masked_array(data =
 |       [[1.0 0.0 0.0]
 |       [0.0 -- 0.0]
 |       [0.0 0.0 1.0]],
 |            mask =
 |       [[False False False]
 |       [False  True False]
 |       [False False False]],
 |            fill_value=1e+20)
 |      >>> x.nonzero()
 |      (array([0, 2]), array([0, 2]))
 |      
 |      Indices can also be grouped by element.
 |      
 |      >>> np.transpose(x.nonzero())
 |      array([[0, 0],
 |             [2, 2]])
 |      
 |      A common use for ``nonzero`` is to find the indices of an array, where
 |      a condition is True.  Given an array `a`, the condition `a` > 3 is a
 |      boolean array and since False is interpreted as 0, ma.nonzero(a > 3)
 |      yields the indices of the `a` where the condition is true.
 |      
 |      >>> a = ma.array([[1,2,3],[4,5,6],[7,8,9]])
 |      >>> a > 3
 |      masked_array(data =
 |       [[False False False]
 |       [ True  True  True]
 |       [ True  True  True]],
 |            mask =
 |       False,
 |            fill_value=999999)
 |      >>> ma.nonzero(a > 3)
 |      (array([1, 1, 1, 2, 2, 2]), array([0, 1, 2, 0, 1, 2]))
 |      
 |      The ``nonzero`` method of the condition array can also be called.
 |      
 |      >>> (a > 3).nonzero()
 |      (array([1, 1, 1, 2, 2, 2]), array([0, 1, 2, 0, 1, 2]))
 |  
 |  prod(self, axis=None, dtype=None, out=None, keepdims=<class numpy._globals._NoValue>)
 |      Return the product of the array elements over the given axis.
 |      
 |      Masked elements are set to 1 internally for computation.
 |      
 |      Refer to `numpy.prod` for full documentation.
 |      
 |      Notes
 |      -----
 |      Arithmetic is modular when using integer types, and no error is raised
 |      on overflow.
 |      
 |      See Also
 |      --------
 |      ndarray.prod : corresponding function for ndarrays
 |      numpy.prod : equivalent function
 |  
 |  product = prod(self, axis=None, dtype=None, out=None, keepdims=<class numpy._globals._NoValue>)
 |      Return the product of the array elements over the given axis.
 |      
 |      Masked elements are set to 1 internally for computation.
 |      
 |      Refer to `numpy.prod` for full documentation.
 |      
 |      Notes
 |      -----
 |      Arithmetic is modular when using integer types, and no error is raised
 |      on overflow.
 |      
 |      See Also
 |      --------
 |      ndarray.prod : corresponding function for ndarrays
 |      numpy.prod : equivalent function
 |  
 |  ptp(self, axis=None, out=None, fill_value=None)
 |      Return (maximum - minimum) along the the given dimension
 |      (i.e. peak-to-peak value).
 |      
 |      Parameters
 |      ----------
 |      axis : {None, int}, optional
 |          Axis along which to find the peaks.  If None (default) the
 |          flattened array is used.
 |      out : {None, array_like}, optional
 |          Alternative output array in which to place the result. It must
 |          have the same shape and buffer length as the expected output
 |          but the type will be cast if necessary.
 |      fill_value : {var}, optional
 |          Value used to fill in the masked values.
 |      
 |      Returns
 |      -------
 |      ptp : ndarray.
 |          A new array holding the result, unless ``out`` was
 |          specified, in which case a reference to ``out`` is returned.
 |  
 |  put(self, indices, values, mode='raise')
 |      Set storage-indexed locations to corresponding values.
 |      
 |      Sets self._data.flat[n] = values[n] for each n in indices.
 |      If `values` is shorter than `indices` then it will repeat.
 |      If `values` has some masked values, the initial mask is updated
 |      in consequence, else the corresponding values are unmasked.
 |      
 |      Parameters
 |      ----------
 |      indices : 1-D array_like
 |          Target indices, interpreted as integers.
 |      values : array_like
 |          Values to place in self._data copy at target indices.
 |      mode : {'raise', 'wrap', 'clip'}, optional
 |          Specifies how out-of-bounds indices will behave.
 |          'raise' : raise an error.
 |          'wrap' : wrap around.
 |          'clip' : clip to the range.
 |      
 |      Notes
 |      -----
 |      `values` can be a scalar or length 1 array.
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
 |      >>> print(x)
 |      [[1 -- 3]
 |       [-- 5 --]
 |       [7 -- 9]]
 |      >>> x.put([0,4,8],[10,20,30])
 |      >>> print(x)
 |      [[10 -- 3]
 |       [-- 20 --]
 |       [7 -- 30]]
 |      
 |      >>> x.put(4,999)
 |      >>> print(x)
 |      [[10 -- 3]
 |       [-- 999 --]
 |       [7 -- 30]]
 |  
 |  ravel(self, order='C')
 |      Returns a 1D version of self, as a view.
 |      
 |      Parameters
 |      ----------
 |      order : {'C', 'F', 'A', 'K'}, optional
 |          The elements of `a` are read using this index order. 'C' means to
 |          index the elements in C-like order, with the last axis index
 |          changing fastest, back to the first axis index changing slowest.
 |          'F' means to index the elements in Fortran-like index order, with
 |          the first index changing fastest, and the last index changing
 |          slowest. Note that the 'C' and 'F' options take no account of the
 |          memory layout of the underlying array, and only refer to the order
 |          of axis indexing.  'A' means to read the elements in Fortran-like
 |          index order if `m` is Fortran *contiguous* in memory, C-like order
 |          otherwise.  'K' means to read the elements in the order they occur
 |          in memory, except for reversing the data when strides are negative.
 |          By default, 'C' index order is used.
 |      
 |      Returns
 |      -------
 |      MaskedArray
 |          Output view is of shape ``(self.size,)`` (or
 |          ``(np.ma.product(self.shape),)``).
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
 |      >>> print(x)
 |      [[1 -- 3]
 |       [-- 5 --]
 |       [7 -- 9]]
 |      >>> print(x.ravel())
 |      [1 -- 3 -- 5 -- 7 -- 9]
 |  
 |  repeat(self, *args, **params)
 |      a.repeat(repeats, axis=None)
 |      
 |      Repeat elements of an array.
 |      
 |      Refer to `numpy.repeat` for full documentation.
 |      
 |      See Also
 |      --------
 |      numpy.repeat : equivalent function
 |  
 |  reshape(self, *s, **kwargs)
 |      Give a new shape to the array without changing its data.
 |      
 |      Returns a masked array containing the same data, but with a new shape.
 |      The result is a view on the original array; if this is not possible, a
 |      ValueError is raised.
 |      
 |      Parameters
 |      ----------
 |      shape : int or tuple of ints
 |          The new shape should be compatible with the original shape. If an
 |          integer is supplied, then the result will be a 1-D array of that
 |          length.
 |      order : {'C', 'F'}, optional
 |          Determines whether the array data should be viewed as in C
 |          (row-major) or FORTRAN (column-major) order.
 |      
 |      Returns
 |      -------
 |      reshaped_array : array
 |          A new view on the array.
 |      
 |      See Also
 |      --------
 |      reshape : Equivalent function in the masked array module.
 |      numpy.ndarray.reshape : Equivalent method on ndarray object.
 |      numpy.reshape : Equivalent function in the NumPy module.
 |      
 |      Notes
 |      -----
 |      The reshaping operation cannot guarantee that a copy will not be made,
 |      to modify the shape in place, use ``a.shape = s``
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([[1,2],[3,4]], mask=[1,0,0,1])
 |      >>> print(x)
 |      [[-- 2]
 |       [3 --]]
 |      >>> x = x.reshape((4,1))
 |      >>> print(x)
 |      [[--]
 |       [2]
 |       [3]
 |       [--]]
 |  
 |  resize(self, newshape, refcheck=True, order=False)
 |      .. warning::
 |      
 |          This method does nothing, except raise a ValueError exception. A
 |          masked array does not own its data and therefore cannot safely be
 |          resized in place. Use the `numpy.ma.resize` function instead.
 |      
 |      This method is difficult to implement safely and may be deprecated in
 |      future releases of NumPy.
 |  
 |  round(self, decimals=0, out=None)
 |      Return each element rounded to the given number of decimals.
 |      
 |      Refer to `numpy.around` for full documentation.
 |      
 |      See Also
 |      --------
 |      ndarray.around : corresponding function for ndarrays
 |      numpy.around : equivalent function
 |  
 |  set_fill_value(self, value=None)
 |      Set the filling value of the masked array.
 |      
 |      Parameters
 |      ----------
 |      value : scalar, optional
 |          The new filling value. Default is None, in which case a default
 |          based on the data type is used.
 |      
 |      See Also
 |      --------
 |      ma.set_fill_value : Equivalent function.
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([0, 1.], fill_value=-np.inf)
 |      >>> x.fill_value
 |      -inf
 |      >>> x.set_fill_value(np.pi)
 |      >>> x.fill_value
 |      3.1415926535897931
 |      
 |      Reset to default:
 |      
 |      >>> x.set_fill_value()
 |      >>> x.fill_value
 |      1e+20
 |  
 |  shrink_mask(self)
 |      Reduce a mask to nomask when possible.
 |      
 |      Parameters
 |      ----------
 |      None
 |      
 |      Returns
 |      -------
 |      None
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([[1,2 ], [3, 4]], mask=[0]*4)
 |      >>> x.mask
 |      array([[False, False],
 |             [False, False]], dtype=bool)
 |      >>> x.shrink_mask()
 |      >>> x.mask
 |      False
 |  
 |  soften_mask(self)
 |      Force the mask to soft.
 |      
 |      Whether the mask of a masked array is hard or soft is determined by
 |      its `hardmask` property. `soften_mask` sets `hardmask` to False.
 |      
 |      See Also
 |      --------
 |      hardmask
 |  
 |  sort(self, axis=-1, kind='quicksort', order=None, endwith=True, fill_value=None)
 |      Sort the array, in-place
 |      
 |      Parameters
 |      ----------
 |      a : array_like
 |          Array to be sorted.
 |      axis : int, optional
 |          Axis along which to sort. If None, the array is flattened before
 |          sorting. The default is -1, which sorts along the last axis.
 |      kind : {'quicksort', 'mergesort', 'heapsort'}, optional
 |          Sorting algorithm. Default is 'quicksort'.
 |      order : list, optional
 |          When `a` is a structured array, this argument specifies which fields
 |          to compare first, second, and so on.  This list does not need to
 |          include all of the fields.
 |      endwith : {True, False}, optional
 |          Whether missing values (if any) should be forced in the upper indices
 |          (at the end of the array) (True) or lower indices (at the beginning).
 |          When the array contains unmasked values of the largest (or smallest if
 |          False) representable value of the datatype the ordering of these values
 |          and the masked values is undefined.  To enforce the masked values are
 |          at the end (beginning) in this case one must sort the mask.
 |      fill_value : {var}, optional
 |          Value used internally for the masked values.
 |          If ``fill_value`` is not None, it supersedes ``endwith``.
 |      
 |      Returns
 |      -------
 |      sorted_array : ndarray
 |          Array of the same type and shape as `a`.
 |      
 |      See Also
 |      --------
 |      ndarray.sort : Method to sort an array in-place.
 |      argsort : Indirect sort.
 |      lexsort : Indirect stable sort on multiple keys.
 |      searchsorted : Find elements in a sorted array.
 |      
 |      Notes
 |      -----
 |      See ``sort`` for notes on the different sorting algorithms.
 |      
 |      Examples
 |      --------
 |      >>> a = ma.array([1, 2, 5, 4, 3],mask=[0, 1, 0, 1, 0])
 |      >>> # Default
 |      >>> a.sort()
 |      >>> print(a)
 |      [1 3 5 -- --]
 |      
 |      >>> a = ma.array([1, 2, 5, 4, 3],mask=[0, 1, 0, 1, 0])
 |      >>> # Put missing values in the front
 |      >>> a.sort(endwith=False)
 |      >>> print(a)
 |      [-- -- 1 3 5]
 |      
 |      >>> a = ma.array([1, 2, 5, 4, 3],mask=[0, 1, 0, 1, 0])
 |      >>> # fill_value takes over endwith
 |      >>> a.sort(endwith=False, fill_value=3)
 |      >>> print(a)
 |      [1 -- -- 3 5]
 |  
 |  squeeze(self, *args, **params)
 |      a.squeeze(axis=None)
 |      
 |      Remove single-dimensional entries from the shape of `a`.
 |      
 |      Refer to `numpy.squeeze` for full documentation.
 |      
 |      See Also
 |      --------
 |      numpy.squeeze : equivalent function
 |  
 |  std(self, axis=None, dtype=None, out=None, ddof=0, keepdims=<class numpy._globals._NoValue>)
 |      Returns the standard deviation of the array elements along given axis.
 |      
 |      Masked entries are ignored.
 |      
 |      Refer to `numpy.std` for full documentation.
 |      
 |      See Also
 |      --------
 |      ndarray.std : corresponding function for ndarrays
 |      numpy.std : Equivalent function
 |  
 |  sum(self, axis=None, dtype=None, out=None, keepdims=<class numpy._globals._NoValue>)
 |      Return the sum of the array elements over the given axis.
 |      
 |      Masked elements are set to 0 internally.
 |      
 |      Refer to `numpy.sum` for full documentation.
 |      
 |      See Also
 |      --------
 |      ndarray.sum : corresponding function for ndarrays
 |      numpy.sum : equivalent function
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
 |      >>> print(x)
 |      [[1 -- 3]
 |       [-- 5 --]
 |       [7 -- 9]]
 |      >>> print(x.sum())
 |      25
 |      >>> print(x.sum(axis=1))
 |      [4 5 16]
 |      >>> print(x.sum(axis=0))
 |      [8 5 12]
 |      >>> print(type(x.sum(axis=0, dtype=np.int64)[0]))
 |      <type 'numpy.int64'>
 |  
 |  swapaxes(self, *args, **params)
 |      a.swapaxes(axis1, axis2)
 |      
 |      Return a view of the array with `axis1` and `axis2` interchanged.
 |      
 |      Refer to `numpy.swapaxes` for full documentation.
 |      
 |      See Also
 |      --------
 |      numpy.swapaxes : equivalent function
 |  
 |  take(self, indices, axis=None, out=None, mode='raise')
 |  
 |  tobytes(self, fill_value=None, order='C')
 |      Return the array data as a string containing the raw bytes in the array.
 |      
 |      The array is filled with a fill value before the string conversion.
 |      
 |      .. versionadded:: 1.9.0
 |      
 |      Parameters
 |      ----------
 |      fill_value : scalar, optional
 |          Value used to fill in the masked values. Deafult is None, in which
 |          case `MaskedArray.fill_value` is used.
 |      order : {'C','F','A'}, optional
 |          Order of the data item in the copy. Default is 'C'.
 |      
 |          - 'C'   -- C order (row major).
 |          - 'F'   -- Fortran order (column major).
 |          - 'A'   -- Any, current order of array.
 |          - None  -- Same as 'A'.
 |      
 |      See Also
 |      --------
 |      ndarray.tobytes
 |      tolist, tofile
 |      
 |      Notes
 |      -----
 |      As for `ndarray.tobytes`, information about the shape, dtype, etc.,
 |      but also about `fill_value`, will be lost.
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
 |      >>> x.tobytes()
 |      '\x01\x00\x00\x00?B\x0f\x00?B\x0f\x00\x04\x00\x00\x00'
 |  
 |  tofile(self, fid, sep='', format='%s')
 |      Save a masked array to a file in binary format.
 |      
 |      .. warning::
 |        This function is not implemented yet.
 |      
 |      Raises
 |      ------
 |      NotImplementedError
 |          When `tofile` is called.
 |  
 |  toflex(self)
 |      Transforms a masked array into a flexible-type array.
 |      
 |      The flexible type array that is returned will have two fields:
 |      
 |      * the ``_data`` field stores the ``_data`` part of the array.
 |      * the ``_mask`` field stores the ``_mask`` part of the array.
 |      
 |      Parameters
 |      ----------
 |      None
 |      
 |      Returns
 |      -------
 |      record : ndarray
 |          A new flexible-type `ndarray` with two fields: the first element
 |          containing a value, the second element containing the corresponding
 |          mask boolean. The returned record shape matches self.shape.
 |      
 |      Notes
 |      -----
 |      A side-effect of transforming a masked array into a flexible `ndarray` is
 |      that meta information (``fill_value``, ...) will be lost.
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
 |      >>> print(x)
 |      [[1 -- 3]
 |       [-- 5 --]
 |       [7 -- 9]]
 |      >>> print(x.toflex())
 |      [[(1, False) (2, True) (3, False)]
 |       [(4, True) (5, False) (6, True)]
 |       [(7, False) (8, True) (9, False)]]
 |  
 |  tolist(self, fill_value=None)
 |      Return the data portion of the masked array as a hierarchical Python list.
 |      
 |      Data items are converted to the nearest compatible Python type.
 |      Masked values are converted to `fill_value`. If `fill_value` is None,
 |      the corresponding entries in the output list will be ``None``.
 |      
 |      Parameters
 |      ----------
 |      fill_value : scalar, optional
 |          The value to use for invalid entries. Default is None.
 |      
 |      Returns
 |      -------
 |      result : list
 |          The Python list representation of the masked array.
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([[1,2,3], [4,5,6], [7,8,9]], mask=[0] + [1,0]*4)
 |      >>> x.tolist()
 |      [[1, None, 3], [None, 5, None], [7, None, 9]]
 |      >>> x.tolist(-999)
 |      [[1, -999, 3], [-999, 5, -999], [7, -999, 9]]
 |  
 |  torecords = toflex(self)
 |      Transforms a masked array into a flexible-type array.
 |      
 |      The flexible type array that is returned will have two fields:
 |      
 |      * the ``_data`` field stores the ``_data`` part of the array.
 |      * the ``_mask`` field stores the ``_mask`` part of the array.
 |      
 |      Parameters
 |      ----------
 |      None
 |      
 |      Returns
 |      -------
 |      record : ndarray
 |          A new flexible-type `ndarray` with two fields: the first element
 |          containing a value, the second element containing the corresponding
 |          mask boolean. The returned record shape matches self.shape.
 |      
 |      Notes
 |      -----
 |      A side-effect of transforming a masked array into a flexible `ndarray` is
 |      that meta information (``fill_value``, ...) will be lost.
 |      
 |      Examples
 |      --------
 |      >>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
 |      >>> print(x)
 |      [[1 -- 3]
 |       [-- 5 --]
 |       [7 -- 9]]
 |      >>> print(x.toflex())
 |      [[(1, False) (2, True) (3, False)]
 |       [(4, True) (5, False) (6, True)]
 |       [(7, False) (8, True) (9, False)]]
 |  
 |  tostring(self, fill_value=None, order='C')
 |      This function is a compatibility alias for tobytes. Despite its name it
 |      returns bytes not strings.
 |  
 |  trace(self, offset=0, axis1=0, axis2=1, dtype=None, out=None)
 |      a.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None)
 |      
 |      Return the sum along diagonals of the array.
 |      
 |      Refer to `numpy.trace` for full documentation.
 |      
 |      See Also
 |      --------
 |      numpy.trace : equivalent function
 |  
 |  transpose(self, *args, **params)
 |      a.transpose(*axes)
 |      
 |      Returns a view of the array with axes transposed.
 |      
 |      For a 1-D array, this has no effect. (To change between column and
 |      row vectors, first cast the 1-D array into a matrix object.)
 |      For a 2-D array, this is the usual matrix transpose.
 |      For an n-D array, if axes are given, their order indicates how the
 |      axes are permuted (see Examples). If axes are not provided and
 |      ``a.shape = (i[0], i[1], ... i[n-2], i[n-1])``, then
 |      ``a.transpose().shape = (i[n-1], i[n-2], ... i[1], i[0])``.
 |      
 |      Parameters
 |      ----------
 |      axes : None, tuple of ints, or `n` ints
 |      
 |       * None or no argument: reverses the order of the axes.
 |      
 |       * tuple of ints: `i` in the `j`-th place in the tuple means `a`'s
 |         `i`-th axis becomes `a.transpose()`'s `j`-th axis.
 |      
 |       * `n` ints: same as an n-tuple of the same ints (this form is
 |         intended simply as a "convenience" alternative to the tuple form)
 |      
 |      Returns
 |      -------
 |      out : ndarray
 |          View of `a`, with axes suitably permuted.
 |      
 |      See Also
 |      --------
 |      ndarray.T : Array property returning the array transposed.
 |      
 |      Examples
 |      --------
 |      >>> a = np.array([[1, 2], [3, 4]])
 |      >>> a
 |      array([[1, 2],
 |             [3, 4]])
 |      >>> a.transpose()
 |      array([[1, 3],
 |             [2, 4]])
 |      >>> a.transpose((1, 0))
 |      array([[1, 3],
 |             [2, 4]])
 |      >>> a.transpose(1, 0)
 |      array([[1, 3],
 |             [2, 4]])
 |  
 |  unshare_mask(self)
 |      Copy the mask and set the sharedmask flag to False.
 |      
 |      Whether the mask is shared between masked arrays can be seen from
 |      the `sharedmask` property. `unshare_mask` ensures the mask is not shared.
 |      A copy of the mask is only made if it was shared.
 |      
 |      See Also
 |      --------
 |      sharedmask
 |  
 |  var(self, axis=None, dtype=None, out=None, ddof=0, keepdims=<class numpy._globals._NoValue>)
 |      Compute the variance along the specified axis.
 |      
 |      Returns the variance of the array elements, a measure of the spread of a
 |      distribution.  The variance is computed for the flattened array by
 |      default, otherwise over the specified axis.
 |      
 |      Parameters
 |      ----------
 |      a : array_like
 |          Array containing numbers whose variance is desired.  If `a` is not an
 |          array, a conversion is attempted.
 |      axis : None or int or tuple of ints, optional
 |          Axis or axes along which the variance is computed.  The default is to
 |          compute the variance of the flattened array.
 |      
 |          .. versionadded: 1.7.0
 |      
 |          If this is a tuple of ints, a variance is performed over multiple axes,
 |          instead of a single axis or all the axes as before.
 |      dtype : data-type, optional
 |          Type to use in computing the variance.  For arrays of integer type
 |          the default is `float32`; for arrays of float types it is the same as
 |          the array type.
 |      out : ndarray, optional
 |          Alternate output array in which to place the result.  It must have
 |          the same shape as the expected output, but the type is cast if
 |          necessary.
 |      ddof : int, optional
 |          "Delta Degrees of Freedom": the divisor used in the calculation is
 |          ``N - ddof``, where ``N`` represents the number of elements. By
 |          default `ddof` is zero.
 |      keepdims : bool, optional
 |          If this is set to True, the axes which are reduced are left
 |          in the result as dimensions with size one. With this option,
 |          the result will broadcast correctly against the original `arr`.
 |      
 |          If the default value is passed, then `keepdims` will not be
 |          passed through to the `var` method of sub-classes of
 |          `ndarray`, however any non-default value will be.  If the
 |          sub-classes `sum` method does not implement `keepdims` any
 |          exceptions will be raised.
 |      
 |      Returns
 |      -------
 |      variance : ndarray, see dtype parameter above
 |          If ``out=None``, returns a new array containing the variance;
 |          otherwise, a reference to the output array is returned.
 |      
 |      See Also
 |      --------
 |      std , mean, nanmean, nanstd, nanvar
 |      numpy.doc.ufuncs : Section "Output arguments"
 |      
 |      Notes
 |      -----
 |      The variance is the average of the squared deviations from the mean,
 |      i.e.,  ``var = mean(abs(x - x.mean())**2)``.
 |      
 |      The mean is normally calculated as ``x.sum() / N``, where ``N = len(x)``.
 |      If, however, `ddof` is specified, the divisor ``N - ddof`` is used
 |      instead.  In standard statistical practice, ``ddof=1`` provides an
 |      unbiased estimator of the variance of a hypothetical infinite population.
 |      ``ddof=0`` provides a maximum likelihood estimate of the variance for
 |      normally distributed variables.
 |      
 |      Note that for complex numbers, the absolute value is taken before
 |      squaring, so that the result is always real and nonnegative.
 |      
 |      For floating-point input, the variance is computed using the same
 |      precision the input has.  Depending on the input data, this can cause
 |      the results to be inaccurate, especially for `float32` (see example
 |      below).  Specifying a higher-accuracy accumulator using the ``dtype``
 |      keyword can alleviate this issue.
 |      
 |      Examples
 |      --------
 |      >>> a = np.array([[1, 2], [3, 4]])
 |      >>> np.var(a)
 |      1.25
 |      >>> np.var(a, axis=0)
 |      array([ 1.,  1.])
 |      >>> np.var(a, axis=1)
 |      array([ 0.25,  0.25])
 |      
 |      In single precision, var() can be inaccurate:
 |      
 |      >>> a = np.zeros((2, 512*512), dtype=np.float32)
 |      >>> a[0, :] = 1.0
 |      >>> a[1, :] = 0.1
 |      >>> np.var(a)
 |      0.20250003
 |      
 |      Computing the variance in float64 is more accurate:
 |      
 |      >>> np.var(a, dtype=np.float64)
 |      0.20249999932944759
 |      >>> ((1-0.55)**2 + (0.1-0.55)**2)/2
 |      0.2025
 |  
 |  view(self, dtype=None, type=None, fill_value=None)
 |      a.view(dtype=None, type=None)
 |      
 |      New view of array with the same data.
 |      
 |      Parameters
 |      ----------
 |      dtype : data-type or ndarray sub-class, optional
 |          Data-type descriptor of the returned view, e.g., float32 or int16. The
 |          default, None, results in the view having the same data-type as `a`.
 |          This argument can also be specified as an ndarray sub-class, which
 |          then specifies the type of the returned object (this is equivalent to
 |          setting the ``type`` parameter).
 |      type : Python type, optional
 |          Type of the returned view, e.g., ndarray or matrix.  Again, the
 |          default None results in type preservation.
 |      
 |      Notes
 |      -----
 |      ``a.view()`` is used two different ways:
 |      
 |      ``a.view(some_dtype)`` or ``a.view(dtype=some_dtype)`` constructs a view
 |      of the array's memory with a different data-type.  This can cause a
 |      reinterpretation of the bytes of memory.
 |      
 |      ``a.view(ndarray_subclass)`` or ``a.view(type=ndarray_subclass)`` just
 |      returns an instance of `ndarray_subclass` that looks at the same array
 |      (same shape, dtype, etc.)  This does not cause a reinterpretation of the
 |      memory.
 |      
 |      For ``a.view(some_dtype)``, if ``some_dtype`` has a different number of
 |      bytes per entry than the previous dtype (for example, converting a
 |      regular array to a structured array), then the behavior of the view
 |      cannot be predicted just from the superficial appearance of ``a`` (shown
 |      by ``print(a)``). It also depends on exactly how ``a`` is stored in
 |      memory. Therefore if ``a`` is C-ordered versus fortran-ordered, versus
 |      defined as a slice or transpose, etc., the view may give different
 |      results.
 |      
 |      
 |      Examples
 |      --------
 |      >>> x = np.array([(1, 2)], dtype=[('a', np.int8), ('b', np.int8)])
 |      
 |      Viewing array data using a different type and dtype:
 |      
 |      >>> y = x.view(dtype=np.int16, type=np.matrix)
 |      >>> y
 |      matrix([[513]], dtype=int16)
 |      >>> print(type(y))
 |      <class 'numpy.matrixlib.defmatrix.matrix'>
 |      
 |      Creating a view on a structured array so it can be used in calculations
 |      
 |      >>> x = np.array([(1, 2),(3,4)], dtype=[('a', np.int8), ('b', np.int8)])
 |      >>> xv = x.view(dtype=np.int8).reshape(-1,2)
 |      >>> xv
 |      array([[1, 2],
 |             [3, 4]], dtype=int8)
 |      >>> xv.mean(0)
 |      array([ 2.,  3.])
 |      
 |      Making changes to the view changes the underlying array
 |      
 |      >>> xv[0,1] = 20
 |      >>> print(x)
 |      [(1, 20) (3, 4)]
 |      
 |      Using a view to convert an array to a recarray:
 |      
 |      >>> z = x.view(np.recarray)
 |      >>> z.a
 |      array([1], dtype=int8)
 |      
 |      Views share data:
 |      
 |      >>> x[0] = (9, 10)
 |      >>> z[0]
 |      (9, 10)
 |      
 |      Views that change the dtype size (bytes per entry) should normally be
 |      avoided on arrays defined by slices, transposes, fortran-ordering, etc.:
 |      
 |      >>> x = np.array([[1,2,3],[4,5,6]], dtype=np.int16)
 |      >>> y = x[:, 0:2]
 |      >>> y
 |      array([[1, 2],
 |             [4, 5]], dtype=int16)
 |      >>> y.view(dtype=[('width', np.int16), ('length', np.int16)])
 |      Traceback (most recent call last):
 |        File "<stdin>", line 1, in <module>
 |      ValueError: new type not compatible with array.
 |      >>> z = y.copy()
 |      >>> z.view(dtype=[('width', np.int16), ('length', np.int16)])
 |      array([[(1, 2)],
 |             [(4, 5)]], dtype=[('width', '<i2'), ('length', '<i2')])
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from numpy.ma.core.MaskedArray:
 |  
 |  T
 |  
 |  baseclass
 |      Class of the underlying data (read-only).
 |  
 |  flat
 |      Flat version of the array.
 |  
 |  hardmask
 |      Hardness of the mask
 |  
 |  imag
 |      Imaginary part.
 |  
 |  mask
 |      Mask
 |  
 |  real
 |      Real part
 |  
 |  recordmask
 |      Return the mask of the records.
 |      
 |      A record is masked when all the fields are masked.
 |  
 |  sharedmask
 |      Share status of the mask (read-only).
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from numpy.ma.core.MaskedArray:
 |  
 |  __array_priority__ = 15
 |  
 |  ----------------------------------------------------------------------
 |  Methods inherited from numpy.ndarray:
 |  
 |  __abs__(...)
 |      x.__abs__() <==> abs(x)
 |  
 |  __and__(...)
 |      x.__and__(y) <==> x&y
 |  
 |  __array__(...)
 |      a.__array__(|dtype) -> reference if type unchanged, copy otherwise.
 |      
 |      Returns either a new reference to self if dtype is not given or a new array
 |      of provided data type if dtype is different from the current dtype of the
 |      array.
 |  
 |  __array_prepare__(...)
 |      a.__array_prepare__(obj) -> Object of same type as ndarray object obj.
 |  
 |  __contains__(...)
 |      x.__contains__(y) <==> y in x
 |  
 |  __copy__(...)
 |      a.__copy__([order])
 |      
 |      Return a copy of the array.
 |      
 |      Parameters
 |      ----------
 |      order : {'C', 'F', 'A'}, optional
 |          If order is 'C' (False) then the result is contiguous (default).
 |          If order is 'Fortran' (True) then the result has fortran order.
 |          If order is 'Any' (None) then the result has fortran order
 |          only if the array already is in fortran order.
 |  
 |  __delitem__(...)
 |      x.__delitem__(y) <==> del x[y]
 |  
 |  __delslice__(...)
 |      x.__delslice__(i, j) <==> del x[i:j]
 |      
 |      Use of negative indices is not supported.
 |  
 |  __divmod__(...)
 |      x.__divmod__(y) <==> divmod(x, y)
 |  
 |  __ge__(...)
 |      x.__ge__(y) <==> x>=y
 |  
 |  __gt__(...)
 |      x.__gt__(y) <==> x>y
 |  
 |  __hex__(...)
 |      x.__hex__() <==> hex(x)
 |  
 |  __iand__(...)
 |      x.__iand__(y) <==> x&=y
 |  
 |  __ilshift__(...)
 |      x.__ilshift__(y) <==> x<<=y
 |  
 |  __imod__(...)
 |      x.__imod__(y) <==> x%=y
 |  
 |  __index__(...)
 |      x[y:z] <==> x[y.__index__():z.__index__()]
 |  
 |  __invert__(...)
 |      x.__invert__() <==> ~x
 |  
 |  __ior__(...)
 |      x.__ior__(y) <==> x|=y
 |  
 |  __irshift__(...)
 |      x.__irshift__(y) <==> x>>=y
 |  
 |  __iter__(...)
 |      x.__iter__() <==> iter(x)
 |  
 |  __ixor__(...)
 |      x.__ixor__(y) <==> x^=y
 |  
 |  __le__(...)
 |      x.__le__(y) <==> x<=y
 |  
 |  __len__(...)
 |      x.__len__() <==> len(x)
 |  
 |  __long__(...)
 |      x.__long__() <==> long(x)
 |  
 |  __lshift__(...)
 |      x.__lshift__(y) <==> x<<y
 |  
 |  __lt__(...)
 |      x.__lt__(y) <==> x<y
 |  
 |  __mod__(...)
 |      x.__mod__(y) <==> x%y
 |  
 |  __neg__(...)
 |      x.__neg__() <==> -x
 |  
 |  __nonzero__(...)
 |      x.__nonzero__() <==> x != 0
 |  
 |  __oct__(...)
 |      x.__oct__() <==> oct(x)
 |  
 |  __or__(...)
 |      x.__or__(y) <==> x|y
 |  
 |  __pos__(...)
 |      x.__pos__() <==> +x
 |  
 |  __rand__(...)
 |      x.__rand__(y) <==> y&x
 |  
 |  __rdiv__(...)
 |      x.__rdiv__(y) <==> y/x
 |  
 |  __rdivmod__(...)
 |      x.__rdivmod__(y) <==> divmod(y, x)
 |  
 |  __rlshift__(...)
 |      x.__rlshift__(y) <==> y<<x
 |  
 |  __rmod__(...)
 |      x.__rmod__(y) <==> y%x
 |  
 |  __ror__(...)
 |      x.__ror__(y) <==> y|x
 |  
 |  __rrshift__(...)
 |      x.__rrshift__(y) <==> y>>x
 |  
 |  __rshift__(...)
 |      x.__rshift__(y) <==> x>>y
 |  
 |  __rxor__(...)
 |      x.__rxor__(y) <==> y^x
 |  
 |  __sizeof__(...)
 |  
 |  __xor__(...)
 |      x.__xor__(y) <==> x^y
 |  
 |  argpartition(...)
 |      a.argpartition(kth, axis=-1, kind='introselect', order=None)
 |      
 |      Returns the indices that would partition this array.
 |      
 |      Refer to `numpy.argpartition` for full documentation.
 |      
 |      .. versionadded:: 1.8.0
 |      
 |      See Also
 |      --------
 |      numpy.argpartition : equivalent function
 |  
 |  byteswap(...)
 |      a.byteswap(inplace)
 |      
 |      Swap the bytes of the array elements
 |      
 |      Toggle between low-endian and big-endian data representation by
 |      returning a byteswapped array, optionally swapped in-place.
 |      
 |      Parameters
 |      ----------
 |      inplace : bool, optional
 |          If ``True``, swap bytes in-place, default is ``False``.
 |      
 |      Returns
 |      -------
 |      out : ndarray
 |          The byteswapped array. If `inplace` is ``True``, this is
 |          a view to self.
 |      
 |      Examples
 |      --------
 |      >>> A = np.array([1, 256, 8755], dtype=np.int16)
 |      >>> map(hex, A)
 |      ['0x1', '0x100', '0x2233']
 |      >>> A.byteswap(True)
 |      array([  256,     1, 13090], dtype=int16)
 |      >>> map(hex, A)
 |      ['0x100', '0x1', '0x3322']
 |      
 |      Arrays of strings are not swapped
 |      
 |      >>> A = np.array(['ceg', 'fac'])
 |      >>> A.byteswap()
 |      array(['ceg', 'fac'],
 |            dtype='|S3')
 |  
 |  choose(...)
 |      a.choose(choices, out=None, mode='raise')
 |      
 |      Use an index array to construct a new array from a set of choices.
 |      
 |      Refer to `numpy.choose` for full documentation.
 |      
 |      See Also
 |      --------
 |      numpy.choose : equivalent function
 |  
 |  conj(...)
 |      a.conj()
 |      
 |      Complex-conjugate all elements.
 |      
 |      Refer to `numpy.conjugate` for full documentation.
 |      
 |      See Also
 |      --------
 |      numpy.conjugate : equivalent function
 |  
 |  conjugate(...)
 |      a.conjugate()
 |      
 |      Return the complex conjugate, element-wise.
 |      
 |      Refer to `numpy.conjugate` for full documentation.
 |      
 |      See Also
 |      --------
 |      numpy.conjugate : equivalent function
 |  
 |  dump(...)
 |      a.dump(file)
 |      
 |      Dump a pickle of the array to the specified file.
 |      The array can be read back with pickle.load or numpy.load.
 |      
 |      Parameters
 |      ----------
 |      file : str
 |          A string naming the dump file.
 |  
 |  dumps(...)
 |      a.dumps()
 |      
 |      Returns the pickle of the array as a string.
 |      pickle.loads or numpy.loads will convert the string back to an array.
 |      
 |      Parameters
 |      ----------
 |      None
 |  
 |  fill(...)
 |      a.fill(value)
 |      
 |      Fill the array with a scalar value.
 |      
 |      Parameters
 |      ----------
 |      value : scalar
 |          All elements of `a` will be assigned this value.
 |      
 |      Examples
 |      --------
 |      >>> a = np.array([1, 2])
 |      >>> a.fill(0)
 |      >>> a
 |      array([0, 0])
 |      >>> a = np.empty(2)
 |      >>> a.fill(1)
 |      >>> a
 |      array([ 1.,  1.])
 |  
 |  getfield(...)
 |      a.getfield(dtype, offset=0)
 |      
 |      Returns a field of the given array as a certain type.
 |      
 |      A field is a view of the array data with a given data-type. The values in
 |      the view are determined by the given type and the offset into the current
 |      array in bytes. The offset needs to be such that the view dtype fits in the
 |      array dtype; for example an array of dtype complex128 has 16-byte elements.
 |      If taking a view with a 32-bit integer (4 bytes), the offset needs to be
 |      between 0 and 12 bytes.
 |      
 |      Parameters
 |      ----------
 |      dtype : str or dtype
 |          The data type of the view. The dtype size of the view can not be larger
 |          than that of the array itself.
 |      offset : int
 |          Number of bytes to skip before beginning the element view.
 |      
 |      Examples
 |      --------
 |      >>> x = np.diag([1.+1.j]*2)
 |      >>> x[1, 1] = 2 + 4.j
 |      >>> x
 |      array([[ 1.+1.j,  0.+0.j],
 |             [ 0.+0.j,  2.+4.j]])
 |      >>> x.getfield(np.float64)
 |      array([[ 1.,  0.],
 |             [ 0.,  2.]])
 |      
 |      By choosing an offset of 8 bytes we can select the complex part of the
 |      array for our view:
 |      
 |      >>> x.getfield(np.float64, offset=8)
 |      array([[ 1.,  0.],
 |         [ 0.,  4.]])
 |  
 |  item(...)
 |      a.item(*args)
 |      
 |      Copy an element of an array to a standard Python scalar and return it.
 |      
 |      Parameters
 |      ----------
 |      \*args : Arguments (variable number and type)
 |      
 |          * none: in this case, the method only works for arrays
 |            with one element (`a.size == 1`), which element is
 |            copied into a standard Python scalar object and returned.
 |      
 |          * int_type: this argument is interpreted as a flat index into
 |            the array, specifying which element to copy and return.
 |      
 |          * tuple of int_types: functions as does a single int_type argument,
 |            except that the argument is interpreted as an nd-index into the
 |            array.
 |      
 |      Returns
 |      -------
 |      z : Standard Python scalar object
 |          A copy of the specified element of the array as a suitable
 |          Python scalar
 |      
 |      Notes
 |      -----
 |      When the data type of `a` is longdouble or clongdouble, item() returns
 |      a scalar array object because there is no available Python scalar that
 |      would not lose information. Void arrays return a buffer object for item(),
 |      unless fields are defined, in which case a tuple is returned.
 |      
 |      `item` is very similar to a[args], except, instead of an array scalar,
 |      a standard Python scalar is returned. This can be useful for speeding up
 |      access to elements of the array and doing arithmetic on elements of the
 |      array using Python's optimized math.
 |      
 |      Examples
 |      --------
 |      >>> x = np.random.randint(9, size=(3, 3))
 |      >>> x
 |      array([[3, 1, 7],
 |             [2, 8, 3],
 |             [8, 5, 3]])
 |      >>> x.item(3)
 |      2
 |      >>> x.item(7)
 |      5
 |      >>> x.item((0, 1))
 |      1
 |      >>> x.item((2, 2))
 |      3
 |  
 |  itemset(...)
 |      a.itemset(*args)
 |      
 |      Insert scalar into an array (scalar is cast to array's dtype, if possible)
 |      
 |      There must be at least 1 argument, and define the last argument
 |      as *item*.  Then, ``a.itemset(*args)`` is equivalent to but faster
 |      than ``a[args] = item``.  The item should be a scalar value and `args`
 |      must select a single item in the array `a`.
 |      
 |      Parameters
 |      ----------
 |      \*args : Arguments
 |          If one argument: a scalar, only used in case `a` is of size 1.
 |          If two arguments: the last argument is the value to be set
 |          and must be a scalar, the first argument specifies a single array
 |          element location. It is either an int or a tuple.
 |      
 |      Notes
 |      -----
 |      Compared to indexing syntax, `itemset` provides some speed increase
 |      for placing a scalar into a particular location in an `ndarray`,
 |      if you must do this.  However, generally this is discouraged:
 |      among other problems, it complicates the appearance of the code.
 |      Also, when using `itemset` (and `item`) inside a loop, be sure
 |      to assign the methods to a local variable to avoid the attribute
 |      look-up at each loop iteration.
 |      
 |      Examples
 |      --------
 |      >>> x = np.random.randint(9, size=(3, 3))
 |      >>> x
 |      array([[3, 1, 7],
 |             [2, 8, 3],
 |             [8, 5, 3]])
 |      >>> x.itemset(4, 0)
 |      >>> x.itemset((2, 2), 9)
 |      >>> x
 |      array([[3, 1, 7],
 |             [2, 0, 3],
 |             [8, 5, 9]])
 |  
 |  newbyteorder(...)
 |      arr.newbyteorder(new_order='S')
 |      
 |      Return the array with the same data viewed with a different byte order.
 |      
 |      Equivalent to::
 |      
 |          arr.view(arr.dtype.newbytorder(new_order))
 |      
 |      Changes are also made in all fields and sub-arrays of the array data
 |      type.
 |      
 |      
 |      
 |      Parameters
 |      ----------
 |      new_order : string, optional
 |          Byte order to force; a value from the byte order specifications
 |          below. `new_order` codes can be any of:
 |      
 |          * 'S' - swap dtype from current to opposite endian
 |          * {'<', 'L'} - little endian
 |          * {'>', 'B'} - big endian
 |          * {'=', 'N'} - native order
 |          * {'|', 'I'} - ignore (no change to byte order)
 |      
 |          The default value ('S') results in swapping the current
 |          byte order. The code does a case-insensitive check on the first
 |          letter of `new_order` for the alternatives above.  For example,
 |          any of 'B' or 'b' or 'biggish' are valid to specify big-endian.
 |      
 |      
 |      Returns
 |      -------
 |      new_arr : array
 |          New array object with the dtype reflecting given change to the
 |          byte order.
 |  
 |  partition(...)
 |      a.partition(kth, axis=-1, kind='introselect', order=None)
 |      
 |      Rearranges the elements in the array in such a way that value of the
 |      element in kth position is in the position it would be in a sorted array.
 |      All elements smaller than the kth element are moved before this element and
 |      all equal or greater are moved behind it. The ordering of the elements in
 |      the two partitions is undefined.
 |      
 |      .. versionadded:: 1.8.0
 |      
 |      Parameters
 |      ----------
 |      kth : int or sequence of ints
 |          Element index to partition by. The kth element value will be in its
 |          final sorted position and all smaller elements will be moved before it
 |          and all equal or greater elements behind it.
 |          The order all elements in the partitions is undefined.
 |          If provided with a sequence of kth it will partition all elements
 |          indexed by kth of them into their sorted position at once.
 |      axis : int, optional
 |          Axis along which to sort. Default is -1, which means sort along the
 |          last axis.
 |      kind : {'introselect'}, optional
 |          Selection algorithm. Default is 'introselect'.
 |      order : str or list of str, optional
 |          When `a` is an array with fields defined, this argument specifies
 |          which fields to compare first, second, etc.  A single field can
 |          be specified as a string, and not all fields need be specified,
 |          but unspecified fields will still be used, in the order in which
 |          they come up in the dtype, to break ties.
 |      
 |      See Also
 |      --------
 |      numpy.partition : Return a parititioned copy of an array.
 |      argpartition : Indirect partition.
 |      sort : Full sort.
 |      
 |      Notes
 |      -----
 |      See ``np.partition`` for notes on the different algorithms.
 |      
 |      Examples
 |      --------
 |      >>> a = np.array([3, 4, 2, 1])
 |      >>> a.partition(a, 3)
 |      >>> a
 |      array([2, 1, 3, 4])
 |      
 |      >>> a.partition((1, 3))
 |      array([1, 2, 3, 4])
 |  
 |  searchsorted(...)
 |      a.searchsorted(v, side='left', sorter=None)
 |      
 |      Find indices where elements of v should be inserted in a to maintain order.
 |      
 |      For full documentation, see `numpy.searchsorted`
 |      
 |      See Also
 |      --------
 |      numpy.searchsorted : equivalent function
 |  
 |  setfield(...)
 |      a.setfield(val, dtype, offset=0)
 |      
 |      Put a value into a specified place in a field defined by a data-type.
 |      
 |      Place `val` into `a`'s field defined by `dtype` and beginning `offset`
 |      bytes into the field.
 |      
 |      Parameters
 |      ----------
 |      val : object
 |          Value to be placed in field.
 |      dtype : dtype object
 |          Data-type of the field in which to place `val`.
 |      offset : int, optional
 |          The number of bytes into the field at which to place `val`.
 |      
 |      Returns
 |      -------
 |      None
 |      
 |      See Also
 |      --------
 |      getfield
 |      
 |      Examples
 |      --------
 |      >>> x = np.eye(3)
 |      >>> x.getfield(np.float64)
 |      array([[ 1.,  0.,  0.],
 |             [ 0.,  1.,  0.],
 |             [ 0.,  0.,  1.]])
 |      >>> x.setfield(3, np.int32)
 |      >>> x.getfield(np.int32)
 |      array([[3, 3, 3],
 |             [3, 3, 3],
 |             [3, 3, 3]])
 |      >>> x
 |      array([[  1.00000000e+000,   1.48219694e-323,   1.48219694e-323],
 |             [  1.48219694e-323,   1.00000000e+000,   1.48219694e-323],
 |             [  1.48219694e-323,   1.48219694e-323,   1.00000000e+000]])
 |      >>> x.setfield(np.eye(3), np.int32)
 |      >>> x
 |      array([[ 1.,  0.,  0.],
 |             [ 0.,  1.,  0.],
 |             [ 0.,  0.,  1.]])
 |  
 |  setflags(...)
 |      a.setflags(write=None, align=None, uic=None)
 |      
 |      Set array flags WRITEABLE, ALIGNED, and UPDATEIFCOPY, respectively.
 |      
 |      These Boolean-valued flags affect how numpy interprets the memory
 |      area used by `a` (see Notes below). The ALIGNED flag can only
 |      be set to True if the data is actually aligned according to the type.
 |      The UPDATEIFCOPY flag can never be set to True. The flag WRITEABLE
 |      can only be set to True if the array owns its own memory, or the
 |      ultimate owner of the memory exposes a writeable buffer interface,
 |      or is a string. (The exception for string is made so that unpickling
 |      can be done without copying memory.)
 |      
 |      Parameters
 |      ----------
 |      write : bool, optional
 |          Describes whether or not `a` can be written to.
 |      align : bool, optional
 |          Describes whether or not `a` is aligned properly for its type.
 |      uic : bool, optional
 |          Describes whether or not `a` is a copy of another "base" array.
 |      
 |      Notes
 |      -----
 |      Array flags provide information about how the memory area used
 |      for the array is to be interpreted. There are 6 Boolean flags
 |      in use, only three of which can be changed by the user:
 |      UPDATEIFCOPY, WRITEABLE, and ALIGNED.
 |      
 |      WRITEABLE (W) the data area can be written to;
 |      
 |      ALIGNED (A) the data and strides are aligned appropriately for the hardware
 |      (as determined by the compiler);
 |      
 |      UPDATEIFCOPY (U) this array is a copy of some other array (referenced
 |      by .base). When this array is deallocated, the base array will be
 |      updated with the contents of this array.
 |      
 |      All flags can be accessed using their first (upper case) letter as well
 |      as the full name.
 |      
 |      Examples
 |      --------
 |      >>> y
 |      array([[3, 1, 7],
 |             [2, 0, 0],
 |             [8, 5, 9]])
 |      >>> y.flags
 |        C_CONTIGUOUS : True
 |        F_CONTIGUOUS : False
 |        OWNDATA : True
 |        WRITEABLE : True
 |        ALIGNED : True
 |        UPDATEIFCOPY : False
 |      >>> y.setflags(write=0, align=0)
 |      >>> y.flags
 |        C_CONTIGUOUS : True
 |        F_CONTIGUOUS : False
 |        OWNDATA : True
 |        WRITEABLE : False
 |        ALIGNED : False
 |        UPDATEIFCOPY : False
 |      >>> y.setflags(uic=1)
 |      Traceback (most recent call last):
 |        File "<stdin>", line 1, in <module>
 |      ValueError: cannot set UPDATEIFCOPY flag to True
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from numpy.ndarray:
 |  
 |  __array_interface__
 |      Array protocol: Python side.
 |  
 |  __array_struct__
 |      Array protocol: C-struct side.
 |  
 |  base
 |      Base object if memory is from some other object.
 |      
 |      Examples
 |      --------
 |      The base of an array that owns its memory is None:
 |      
 |      >>> x = np.array([1,2,3,4])
 |      >>> x.base is None
 |      True
 |      
 |      Slicing creates a view, whose memory is shared with x:
 |      
 |      >>> y = x[2:]
 |      >>> y.base is x
 |      True
 |  
 |  ctypes
 |      An object to simplify the interaction of the array with the ctypes
 |      module.
 |      
 |      This attribute creates an object that makes it easier to use arrays
 |      when calling shared libraries with the ctypes module. The returned
 |      object has, among others, data, shape, and strides attributes (see
 |      Notes below) which themselves return ctypes objects that can be used
 |      as arguments to a shared library.
 |      
 |      Parameters
 |      ----------
 |      None
 |      
 |      Returns
 |      -------
 |      c : Python object
 |          Possessing attributes data, shape, strides, etc.
 |      
 |      See Also
 |      --------
 |      numpy.ctypeslib
 |      
 |      Notes
 |      -----
 |      Below are the public attributes of this object which were documented
 |      in "Guide to NumPy" (we have omitted undocumented public attributes,
 |      as well as documented private attributes):
 |      
 |      * data: A pointer to the memory area of the array as a Python integer.
 |        This memory area may contain data that is not aligned, or not in correct
 |        byte-order. The memory area may not even be writeable. The array
 |        flags and data-type of this array should be respected when passing this
 |        attribute to arbitrary C-code to avoid trouble that can include Python
 |        crashing. User Beware! The value of this attribute is exactly the same
 |        as self._array_interface_['data'][0].
 |      
 |      * shape (c_intp*self.ndim): A ctypes array of length self.ndim where
 |        the basetype is the C-integer corresponding to dtype('p') on this
 |        platform. This base-type could be c_int, c_long, or c_longlong
 |        depending on the platform. The c_intp type is defined accordingly in
 |        numpy.ctypeslib. The ctypes array contains the shape of the underlying
 |        array.
 |      
 |      * strides (c_intp*self.ndim): A ctypes array of length self.ndim where
 |        the basetype is the same as for the shape attribute. This ctypes array
 |        contains the strides information from the underlying array. This strides
 |        information is important for showing how many bytes must be jumped to
 |        get to the next element in the array.
 |      
 |      * data_as(obj): Return the data pointer cast to a particular c-types object.
 |        For example, calling self._as_parameter_ is equivalent to
 |        self.data_as(ctypes.c_void_p). Perhaps you want to use the data as a
 |        pointer to a ctypes array of floating-point data:
 |        self.data_as(ctypes.POINTER(ctypes.c_double)).
 |      
 |      * shape_as(obj): Return the shape tuple as an array of some other c-types
 |        type. For example: self.shape_as(ctypes.c_short).
 |      
 |      * strides_as(obj): Return the strides tuple as an array of some other
 |        c-types type. For example: self.strides_as(ctypes.c_longlong).
 |      
 |      Be careful using the ctypes attribute - especially on temporary
 |      arrays or arrays constructed on the fly. For example, calling
 |      ``(a+b).ctypes.data_as(ctypes.c_void_p)`` returns a pointer to memory
 |      that is invalid because the array created as (a+b) is deallocated
 |      before the next Python statement. You can avoid this problem using
 |      either ``c=a+b`` or ``ct=(a+b).ctypes``. In the latter case, ct will
 |      hold a reference to the array until ct is deleted or re-assigned.
 |      
 |      If the ctypes module is not available, then the ctypes attribute
 |      of array objects still returns something useful, but ctypes objects
 |      are not returned and errors may be raised instead. In particular,
 |      the object will still have the as parameter attribute which will
 |      return an integer equal to the data attribute.
 |      
 |      Examples
 |      --------
 |      >>> import ctypes
 |      >>> x
 |      array([[0, 1],
 |             [2, 3]])
 |      >>> x.ctypes.data
 |      30439712
 |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_long))
 |      <ctypes.LP_c_long object at 0x01F01300>
 |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_long)).contents
 |      c_long(0)
 |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_longlong)).contents
 |      c_longlong(4294967296L)
 |      >>> x.ctypes.shape
 |      <numpy.core._internal.c_long_Array_2 object at 0x01FFD580>
 |      >>> x.ctypes.shape_as(ctypes.c_long)
 |      <numpy.core._internal.c_long_Array_2 object at 0x01FCE620>
 |      >>> x.ctypes.strides
 |      <numpy.core._internal.c_long_Array_2 object at 0x01FCE620>
 |      >>> x.ctypes.strides_as(ctypes.c_longlong)
 |      <numpy.core._internal.c_longlong_Array_2 object at 0x01F01300>
 |  
 |  dtype
 |      Data-type of the array's elements.
 |      
 |      Parameters
 |      ----------
 |      None
 |      
 |      Returns
 |      -------
 |      d : numpy dtype object
 |      
 |      See Also
 |      --------
 |      numpy.dtype
 |      
 |      Examples
 |      --------
 |      >>> x
 |      array([[0, 1],
 |             [2, 3]])
 |      >>> x.dtype
 |      dtype('int32')
 |      >>> type(x.dtype)
 |      <type 'numpy.dtype'>
 |  
 |  flags
 |      Information about the memory layout of the array.
 |      
 |      Attributes
 |      ----------
 |      C_CONTIGUOUS (C)
 |          The data is in a single, C-style contiguous segment.
 |      F_CONTIGUOUS (F)
 |          The data is in a single, Fortran-style contiguous segment.
 |      OWNDATA (O)
 |          The array owns the memory it uses or borrows it from another object.
 |      WRITEABLE (W)
 |          The data area can be written to.  Setting this to False locks
 |          the data, making it read-only.  A view (slice, etc.) inherits WRITEABLE
 |          from its base array at creation time, but a view of a writeable
 |          array may be subsequently locked while the base array remains writeable.
 |          (The opposite is not true, in that a view of a locked array may not
 |          be made writeable.  However, currently, locking a base object does not
 |          lock any views that already reference it, so under that circumstance it
 |          is possible to alter the contents of a locked array via a previously
 |          created writeable view onto it.)  Attempting to change a non-writeable
 |          array raises a RuntimeError exception.
 |      ALIGNED (A)
 |          The data and all elements are aligned appropriately for the hardware.
 |      UPDATEIFCOPY (U)
 |          This array is a copy of some other array. When this array is
 |          deallocated, the base array will be updated with the contents of
 |          this array.
 |      FNC
 |          F_CONTIGUOUS and not C_CONTIGUOUS.
 |      FORC
 |          F_CONTIGUOUS or C_CONTIGUOUS (one-segment test).
 |      BEHAVED (B)
 |          ALIGNED and WRITEABLE.
 |      CARRAY (CA)
 |          BEHAVED and C_CONTIGUOUS.
 |      FARRAY (FA)
 |          BEHAVED and F_CONTIGUOUS and not C_CONTIGUOUS.
 |      
 |      Notes
 |      -----
 |      The `flags` object can be accessed dictionary-like (as in ``a.flags['WRITEABLE']``),
 |      or by using lowercased attribute names (as in ``a.flags.writeable``). Short flag
 |      names are only supported in dictionary access.
 |      
 |      Only the UPDATEIFCOPY, WRITEABLE, and ALIGNED flags can be changed by
 |      the user, via direct assignment to the attribute or dictionary entry,
 |      or by calling `ndarray.setflags`.
 |      
 |      The array flags cannot be set arbitrarily:
 |      
 |      - UPDATEIFCOPY can only be set ``False``.
 |      - ALIGNED can only be set ``True`` if the data is truly aligned.
 |      - WRITEABLE can only be set ``True`` if the array owns its own memory
 |        or the ultimate owner of the memory exposes a writeable buffer
 |        interface or is a string.
 |      
 |      Arrays can be both C-style and Fortran-style contiguous simultaneously.
 |      This is clear for 1-dimensional arrays, but can also be true for higher
 |      dimensional arrays.
 |      
 |      Even for contiguous arrays a stride for a given dimension
 |      ``arr.strides[dim]`` may be *arbitrary* if ``arr.shape[dim] == 1``
 |      or the array has no elements.
 |      It does *not* generally hold that ``self.strides[-1] == self.itemsize``
 |      for C-style contiguous arrays or ``self.strides[0] == self.itemsize`` for
 |      Fortran-style contiguous arrays is true.
 |  
 |  itemsize
 |      Length of one array element in bytes.
 |      
 |      Examples
 |      --------
 |      >>> x = np.array([1,2,3], dtype=np.float64)
 |      >>> x.itemsize
 |      8
 |      >>> x = np.array([1,2,3], dtype=np.complex128)
 |      >>> x.itemsize
 |      16
 |  
 |  nbytes
 |      Total bytes consumed by the elements of the array.
 |      
 |      Notes
 |      -----
 |      Does not include memory consumed by non-element attributes of the
 |      array object.
 |      
 |      Examples
 |      --------
 |      >>> x = np.zeros((3,5,2), dtype=np.complex128)
 |      >>> x.nbytes
 |      480
 |      >>> np.prod(x.shape) * x.itemsize
 |      480
 |  
 |  ndim
 |      Number of array dimensions.
 |      
 |      Examples
 |      --------
 |      >>> x = np.array([1, 2, 3])
 |      >>> x.ndim
 |      1
 |      >>> y = np.zeros((2, 3, 4))
 |      >>> y.ndim
 |      3
 |  
 |  shape
 |      Tuple of array dimensions.
 |      
 |      Notes
 |      -----
 |      May be used to "reshape" the array, as long as this would not
 |      require a change in the total number of elements
 |      
 |      Examples
 |      --------
 |      >>> x = np.array([1, 2, 3, 4])
 |      >>> x.shape
 |      (4,)
 |      >>> y = np.zeros((2, 3, 4))
 |      >>> y.shape
 |      (2, 3, 4)
 |      >>> y.shape = (3, 8)
 |      >>> y
 |      array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
 |             [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
 |             [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]])
 |      >>> y.shape = (3, 6)
 |      Traceback (most recent call last):
 |        File "<stdin>", line 1, in <module>
 |      ValueError: total size of new array must be unchanged
 |  
 |  size
 |      Number of elements in the array.
 |      
 |      Equivalent to ``np.prod(a.shape)``, i.e., the product of the array's
 |      dimensions.
 |      
 |      Examples
 |      --------
 |      >>> x = np.zeros((3, 5, 2), dtype=np.complex128)
 |      >>> x.size
 |      30
 |      >>> np.prod(x.shape)
 |      30
 |  
 |  strides
 |      Tuple of bytes to step in each dimension when traversing an array.
 |      
 |      The byte offset of element ``(i[0], i[1], ..., i[n])`` in an array `a`
 |      is::
 |      
 |          offset = sum(np.array(i) * a.strides)
 |      
 |      A more detailed explanation of strides can be found in the
 |      "ndarray.rst" file in the NumPy reference guide.
 |      
 |      Notes
 |      -----
 |      Imagine an array of 32-bit integers (each 4 bytes)::
 |      
 |        x = np.array([[0, 1, 2, 3, 4],
 |                      [5, 6, 7, 8, 9]], dtype=np.int32)
 |      
 |      This array is stored in memory as 40 bytes, one after the other
 |      (known as a contiguous block of memory).  The strides of an array tell
 |      us how many bytes we have to skip in memory to move to the next position
 |      along a certain axis.  For example, we have to skip 4 bytes (1 value) to
 |      move to the next column, but 20 bytes (5 values) to get to the same
 |      position in the next row.  As such, the strides for the array `x` will be
 |      ``(20, 4)``.
 |      
 |      See Also
 |      --------
 |      numpy.lib.stride_tricks.as_strided
 |      
 |      Examples
 |      --------
 |      >>> y = np.reshape(np.arange(2*3*4), (2,3,4))
 |      >>> y
 |      array([[[ 0,  1,  2,  3],
 |              [ 4,  5,  6,  7],
 |              [ 8,  9, 10, 11]],
 |             [[12, 13, 14, 15],
 |              [16, 17, 18, 19],
 |              [20, 21, 22, 23]]])
 |      >>> y.strides
 |      (48, 16, 4)
 |      >>> y[1,1,1]
 |      17
 |      >>> offset=sum(y.strides * np.array((1,1,1)))
 |      >>> offset/y.itemsize
 |      17
 |      
 |      >>> x = np.reshape(np.arange(5*6*7*8), (5,6,7,8)).transpose(2,3,1,0)
 |      >>> x.strides
 |      (32, 4, 224, 1344)
 |      >>> i = np.array([3,5,2,2])
 |      >>> offset = sum(i * x.strides)
 |      >>> x[3,5,2,2]
 |      813
 |      >>> offset / x.itemsize
 |      813
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from numpy.ndarray:
 |  
 |  __hash__ = None


In [54]:
np.where(hmqdat['Z']<=0.25)


Out[54]:
(array([    0,     1,     2, ..., 37950, 37951, 37952]),)

In [55]:
np.where(hmqdat['Z']>0)


Out[55]:
(array([    67,     68,     69, ..., 510352, 510353, 510354]),)

In [56]:
hmqbin1=hmqdat[67:37952]

In [57]:
hmqbin1


Out[57]:
<Table length=37885>
ZRADEC
float64float64float64
0.00111.887875-25.288639
0.001188.91611112.556111
0.001190.71833313.257222
0.001192.72055641.120278
0.001194.182521.683056
0.001197.94599-0.289915
0.001201.365583-43.018806
0.001202.46833347.194722
0.001202.58968244.688984
0.001204.983292-31.640083
.........
0.25258.5534242.34074
0.25258.86727954.419169
0.25259.53698331.494097
0.25267.562564.248889
0.25324.969722-43.252778
0.25325.47855810.752208
0.25339.553083-39.672028
0.25343.056389-8.963333
0.25345.75952-0.283827
0.25346.553822-0.986816

In [58]:
ascii.write(hmqbin1,"./output/hmqbin1.dat")

In [59]:
len(hmqbin1)


Out[59]:
37885

In [ ]:


In [60]:
randra,randdec=hu.randsphere(37885)
randz=0.25*np.random.random_sample(37885)

In [61]:
randz


Out[61]:
array([ 0.09055629,  0.17966635,  0.19842346, ...,  0.00283044,
        0.14986337,  0.1608593 ])

In [62]:
randra


Out[62]:
array([  82.83397398,   16.6656554 ,  165.51338515, ...,  115.29707449,
        191.65893917,  258.64839955])

In [63]:
randdec


Out[63]:
array([-31.4041433 , -32.79569862,  22.5723584 , ..., -28.97524559,
        77.49756571, -28.649747  ])

In [64]:
rdat = Table([randz, randra, randdec], names=('Z', 'RA', 'DEC'))

In [65]:
ascii.write(rdat,"./input/rdatf.dat")

In [66]:
rdat


Out[66]:
<Table length=37885>
ZRADEC
float64float64float64
0.090556294765882.8339739799-31.4041432973
0.17966635020116.6656554042-32.7956986173
0.198423456837165.51338515422.5723583964
0.0269945747649.8786430626-47.9838130232
0.249567027275189.926592265-14.1726643577
0.20805363853410.1352114864-63.9908692299
0.123940268516347.577168388-46.005290915
0.0208993081512321.130083571-49.7373804336
0.0597156114309330.07736732818.4620279676
0.20782996978255.8054223472-32.5626952012
.........
0.22630613076272.347986703-32.6878124709
0.17417361379236.947505738-15.7671372385
0.0508709212651281.209876081-34.3132613188
0.199287293881329.683055775-80.2396491292
0.0213769230744208.34418634242.9564082458
0.0902636684931286.865628061-32.0319052474
0.127189969569314.31914424829.6982196894
0.00283043855431115.297074488-28.9752455884
0.149863371893191.65893916777.4975657083
0.160859297555258.648399553-28.6497470047

In [67]:
rdat.sort('Z')

In [69]:
ascii.write(rdat,"./input/rdatf.dat",overwrite=True)

In [68]:
rdat


Out[68]:
<Table length=37885>
ZRADEC
float64float64float64
4.79121475247e-0672.377373403520.0512320354
5.16724118113e-06308.925925565-8.31255335055
1.89522769875e-05173.013645184-29.9838208208
1.92138087725e-0518.997778548420.678293975
2.57349485492e-05152.521111935.2451365534
2.63532549121e-0573.515340263624.7532901221
3.06301354178e-05120.893419183-13.7621959652
3.32600533562e-05322.55041759360.4296693751
4.31786092999e-05146.01388324-35.8467792924
4.67327098299e-05237.51372663352.0480118728
.........
0.249960006208116.379850093-53.0303303762
0.24996322218331.930717171-32.5528434175
0.249967582637259.68649147422.3017647038
0.249969846884333.555452555-35.6429474841
0.24997289713352.9619175-35.8820385318
0.2499758984879.717929980521.0700356321
0.249987342502265.701246713-18.6488828952
0.249988319448324.7062260675.7962410009
0.249992068468281.763179587-11.5775508903
0.2499935679169.416849142752.2534973327

In [78]:
#Creating output file 
ddpair = open("./output/ddbin1pair.dat",'w')
# We intend to obtain average redshift of the pair and deltaZ deltatheta Zdeltatheta values first essentially finding right pairs
ddpair.write("Z\t deltaZ\t deltatheta\t Zdeltatheta\n")
#Algorithm keeps removing rows after done finding quasars within deltaZ˜0.02 
start_time=time.time()
while len(hmqbin1['Z'])>1:
    j=1
    while hmqbin1[j]['Z']<=(hmqbin1[0]['Z']+0.05):
        deltaZ=abs(hmqbin1[j]['Z']-hmqbin1[0]['Z'])
        Z=(hmqbin1[j]['Z']+hmqbin1[0]['Z'])/2.0
        RA1=hmqbin1[0]['RA']*math.pi/180.0
        RA2=hmqbin1[j]['RA']*math.pi/180.0
        DEC1=hmqbin1[0]['DEC']*math.pi/180.0
        DEC2=hmqbin1[j]['DEC']*math.pi/180.0
        deltatheta=abs(math.acos(math.sin(DEC1)*math.sin(DEC2)+math.cos(DEC1)*math.cos(DEC2)*math.cos(RA1-RA2)))
        Zdeltatheta=Z*deltatheta
        if Zdeltatheta<=0.05:
            ddpair.write("%f\t %f\t %f\t %f\n" %(Z, deltaZ, deltatheta, Zdeltatheta))
        j=j+1
    hmqbin1.remove_row(0)
ddpair.close()
print "Total time taken to run: "
print time.time()-start_time


---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-78-a60bd2d973f0> in <module>()
      7 while len(hmqbin1['Z'])>1:
      8     j=1
----> 9     while hmqbin1[j]['Z']<=(hmqbin1[0]['Z']+0.05):
     10         deltaZ=abs(hmqbin1[j]['Z']-hmqbin1[0]['Z'])
     11         Z=(hmqbin1[j]['Z']+hmqbin1[0]['Z'])/2.0

/Users/rohin/anaconda/lib/python2.7/site-packages/astropy/table/table.pyc in __getitem__(self, item)
   1196             return self.columns[item]
   1197         elif isinstance(item, (int, np.integer)):
-> 1198             return self.Row(self, item)
   1199         elif (isinstance(item, (tuple, list)) and item and
   1200               all(isinstance(x, six.string_types) for x in item)):

/Users/rohin/anaconda/lib/python2.7/site-packages/astropy/table/row.pyc in __init__(self, table, index)
     41         if index < -n or index >= n:
     42             raise IndexError('index {0} out of range for table with length {1}'
---> 43                              .format(index, len(table)))
     44 
     45     def __getitem__(self, item):

IndexError: index 5744 out of range for table with length 5744

In [79]:
hmqbin1


Out[79]:
<Table length=5744>
ZRADEC
float64float64float64
0.20.101708-12.763306
0.20.4554023.95228
0.27.84166730.267222
0.27.904592-18.724134
0.28.5937982.777765
0.29.3990290.219421
0.29.805841-2.951965
0.210.8576450.65956
0.211.359589-3.652243
0.213.59066115.574256
.........
0.25258.5534242.34074
0.25258.86727954.419169
0.25259.53698331.494097
0.25267.562564.248889
0.25324.969722-43.252778
0.25325.47855810.752208
0.25339.553083-39.672028
0.25343.056389-8.963333
0.25345.75952-0.283827
0.25346.553822-0.986816

In [70]:
from astropy.table import vstack

In [74]:
rdraw=vstack([hmqbin1,rdat])

In [76]:
rdraw.sort('Z')

In [77]:
rdraw


Out[77]:
<Table length=75770>
ZRADEC
float64float64float64
4.79121475247e-0672.377373403520.0512320354
5.16724118113e-06308.925925565-8.31255335055
1.89522769875e-05173.013645184-29.9838208208
1.92138087725e-0518.997778548420.678293975
2.57349485492e-05152.521111935.2451365534
2.63532549121e-0573.515340263624.7532901221
3.06301354178e-05120.893419183-13.7621959652
3.32600533562e-05322.55041759360.4296693751
4.31786092999e-05146.01388324-35.8467792924
4.67327098299e-05237.51372663352.0480118728
.........
0.25203.1799137.63222
0.25204.40517131.270606
0.25204.70186445.77337
0.25205.06027833.4125
0.25207.2225567.946605
0.25208.7147729.425905
0.25210.4144442.95594
0.25210.8421172.375816
0.25198.65487712.805779
0.25346.553822-0.986816

In [80]:
hmqdat1=ascii.read("./output/hmqbin1.dat")

In [ ]:
#Creating output file 
rdpair = open("./output/rdbin1pair.dat",'w')
# We intend to obtain average redshift of the pair and deltaZ deltatheta Zdeltatheta values first essentially finding right pairs
rdpair.write("Z\t deltaZ\t deltatheta\t Zdeltatheta\n")
#Algorithm keeps removing rows after done finding quasars within deltaZ˜0.02 
start_time=time.time()
while len(hmqdat1['Z'])>1:
    #j=0
    for j in range(0,len(rdat['Z'])):
        if rdat[j]['Z']<=(hmqdat1[0]['Z']+0.05):
            deltaZ=abs(rdat[j]['Z']-hmqdat1[0]['Z'])
            Z=(rdat[j]['Z']+hmqdat1[0]['Z'])/2.0
            RA1=hmqdat1[0]['RA']*math.pi/180.0
            RA2=rdat[j]['RA']*math.pi/180.0
            DEC1=hmqdat1[0]['DEC']*math.pi/180.0
            DEC2=rdat[j]['DEC']*math.pi/180.0
            deltatheta=abs(math.acos(math.sin(DEC1)*math.sin(DEC2)+math.cos(DEC1)*math.cos(DEC2)*math.cos(RA1-RA2)))
            Zdeltatheta=Z*deltatheta
            if Zdeltatheta<=0.05:
                rdpair.write("%f\t %f\t %f\t %f\n" %(Z, deltaZ, deltatheta, Zdeltatheta))
        #j=j+1
    hmqdat1.remove_row(0)
rdpair.close()
print "Total time taken to run: "
print time.time()-start_time

In [ ]:


In [ ]:
#Creating output file 
rrpair = open("./output/rrbin1pair.dat",'w')
# We intend to obtain average redshift of the pair and deltaZ deltatheta Zdeltatheta values first essentially finding right pairs
rrpair.write("Z\t deltaZ\t deltatheta\t Zdeltatheta\n")
#Algorithm keeps removing rows after done finding quasars within deltaZ˜0.02 
start_time=time.time()
while len(rdat['Z'])>1:
    j=1
    while rdat[j]['Z']<=(rdat[0]['Z']+0.05):
        deltaZ=abs(rdat[j]['Z']-rdat[0]['Z'])
        Z=(rdat[j]['Z']+rdat[0]['Z'])/2.0
        RA1=rdat[0]['RA']*math.pi/180.0
        RA2=rdat[j]['RA']*math.pi/180.0
        DEC1=rdat[0]['DEC']*math.pi/180.0
        DEC2=rdat[j]['DEC']*math.pi/180.0
        deltatheta=abs(math.acos(math.sin(DEC1)*math.sin(DEC2)+math.cos(DEC1)*math.cos(DEC2)*math.cos(RA1-RA2)))
        Zdeltatheta=Z*deltatheta
        if Zdeltatheta<=0.05:
            rrpair.write("%f\t %f\t %f\t %f\n" %(Z, deltaZ, deltatheta, Zdeltatheta))
        j=j+1
    rdat.remove_row(0)
rrpair.close()
print "Total time taken to run: "
print time.time()-start_time