I have 2 directories:
And in these 2 zip folders, 7 test files are present. I am trying this code to work on these:
import pandas as pd
import zipfile
from zipfile import ZipFile
def get_vcf_names(vcf_path):
with ZipFile.open(vcf_path, "rt") as ifile:
for line in ifile:
if line.startswith("#CHROM"):
vcf_names = [x for x in line.split('\t')]
break
ifile.close()
return vcf_names
names = get_vcf_names('VCFs_1.zip')
vcf = pd.read_csv('VCFs_1.zip', compression='zip', comment='#', chunksize=10000, delim_whitespace=True, header=None, names=names)
but its giving me:
AttributeError: 'str' object has no attribute 'fp'