text_html_output_1.png
from glob import glob

import pandas as pd

from glob import glob
basepath = '../input/train/'
all_cervix_images = []
for path in glob(basepath + '*'):
    cervix_type = path.split('/')[-1]
    cervix_images = glob(basepath + cervix_type + '/*')
    all_cervix_images = all_cervix_images + cervix_images
all_cervix_images = pd.DataFrame({'imagepath': all_cervix_images})
all_cervix_images['filetype'] = all_cervix_images.apply(lambda row: row.imagepath.split('.')[-1], axis=1)
all_cervix_images['type'] = all_cervix_images.apply(lambda row: row.imagepath.split('/')[-2], axis=1)
all_cervix_images.head()