This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Read .sample file (file format available in plink) as a dataframe in pandas

I have a .sample file that I need to load in a dataframe in pandas (in python) for some further computation.Can somebody suggest any appropriate method...The format of my file is as follows:-

ID POP  GROU    P SE    X
HG00096 GBR EUR male
HG00097 GBR EUR female
HG00099 GBR EUR female
HG00100 GBR EUR female
HG00101 GBR EUR male
HG00102 GBR EUR female
........
........
imputation plink pandas

1 answer

If it's just a tabular text file, then use read_csv , e.g.

import pandas as pd
df = pd.read_csv('.sample', sep='\t')

Log in to answer this question.