In [1]:
import sys
sys.path.insert(0, '../..')
import numpy as np
import allel; print(allel.__version__)
In [2]:
h = allel.HaplotypeArray([[0, 1], [1, 0]])
h
Out[2]:
In [3]:
%matplotlib inline
import matplotlib.pyplot as plt
In [4]:
h.reshape(-1)
Out[4]:
In [5]:
h.flatten()
Out[5]:
In [6]:
h.ravel()
Out[6]:
In [7]:
plt.pcolormesh(h);
In [8]:
plt.pcolormesh(h, vmin=0, vmax=1);
In [9]:
h.T
Out[9]:
In [10]:
h.transpose()
Out[10]:
In [11]:
np.moveaxis(h, 0, 1)
Out[11]:
In [12]:
h.astype('i1')
Out[12]:
In [13]:
h.astype('f4')
Out[13]:
In [ ]: