Skip to content

Instantly share code, notes, and snippets.

@tashrifbillah
Created February 5, 2026 22:03
Show Gist options
  • Select an option

  • Save tashrifbillah/e030aa684a4a156648e42dc7510c46c6 to your computer and use it in GitHub Desktop.

Select an option

Save tashrifbillah/e030aa684a4a156648e42dc7510c46c6 to your computer and use it in GitHub Desktop.
Parse figs_m01 values /data/predict1/data_from_nda/Prescient/PHOENIX/PROTECTED
# Execute it within
import pandas as pd
from glob import glob
files=glob('Prescient??/raw/*/surveys/???????_family_interview_for_genetic_studies_figs.csv')
v='chrfigs_mother_m01'
values=[]
for file in files:
df=pd.read_csv(file, dtype=str, keep_default_na=False)
if df.shape[0]>1:
print(file)
else:
values.append(df.loc[0,v])
print(set(values))
v='chrfigs_father_m01'
values=[]
for file in files:
df=pd.read_csv(file, dtype=str, keep_default_na=False)
if df.shape[0]>1:
print(file)
else:
values.append(df.loc[0,v])
print(set(values))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment