Last active
February 7, 2023 04:15
-
-
Save tashrifbillah/48deae932825d282333211abc8b08f66 to your computer and use it in GitHub Desktop.
Debug form qc excess row problems
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
#!/usr/bin/env python | |
# detect files with excess rows | |
# cd /data/predict1/data_from_nda/formqc/ | |
from glob import glob | |
import pandas as pd | |
files=glob('??-*-form_*day1to*csv') | |
for file in files: | |
to=int(file.split('-day1to')[-1].strip('.csv')) | |
df=pd.read_csv(file) | |
L=len(df) | |
if L>to: | |
print(L,file) | |
# detect max days | |
files=glob('??-*-form_*day1to*csv') | |
max_day=1 | |
for file in files: | |
to=int(file.split('-day1to')[-1].strip('.csv')) | |
if to>max_day: | |
print(to,file) | |
max_day=to | |
print(max_day) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment