Created
March 8, 2013 02:47
-
-
Save indapa/5113856 to your computer and use it in GitHub Desktop.
Using dtype object and loadtxt command to read file contents into a Numpy array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#simref.1 653 T TT GT TT | |
#simref.1 1216 T CC CC CC | |
#simref.1 1440 A AA AG AA | |
#simref.1 1470 A CC CC CC | |
#simref.1 2070 C AA AA AA | |
#simref.1 2489 C GG GG GG | |
import numpy as np | |
dt = np.dtype( [ ('chrom', 'S8'), ('pos', 'int32'), ('ref','S1'), ('father','S2'), ('mother','S2'), ('child','S2')] ) | |
pgm_array=np.loadtxt(file,delimiter='\t',dtype=dt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment