text_plain_output_1.png
import os

import os

import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

train_img_csv = '../input/my-pre-data/MURA-v1.1/abdekho_train.csv'
train_images_paths = pd.read_csv(os.path.join(train_img_csv), dtype=str, header=None)
train_images_paths.columns = ['image_path']
valid_img_csv = '../input/my-pre-data/MURA-v1.1/abdekho_valid.csv'
valid_images_paths = pd.read_csv(os.path.join(valid_img_csv), dtype=str, header=None)
valid_images_paths.columns = ['image_path']
train_images_paths['label'] = train_images_paths['image_path'].map(lambda x: '1' if 'positive' in x else '0')
train_images_paths['category'] = train_images_paths['image_path'].apply(lambda x: x.split('/')[2])
valid_images_paths['label'] = valid_images_paths['image_path'].map(lambda x: '1' if 'positive' in x else '0')
valid_images_paths['category'] = valid_images_paths['image_path'].apply(lambda x: x.split('/')[2])

train_images_paths_XR_FINGER = train_images_paths[train_images_paths['category'] == 'XR_FINGER']
print('\n\npositive casses:', len(train_images_paths_XR_FINGER[train_images_paths_XR_FINGER['label'] == '1']))
print('\n\nnegative casses:', len(train_images_paths_XR_FINGER[train_images_paths_XR_FINGER['label'] == '0']))
valid_images_paths_XR_FINGER = valid_images_paths[valid_images_paths['category'] == 'XR_FINGER']
print('\n\npositive casses:', len(valid_images_paths_XR_FINGER[valid_images_paths_XR_FINGER['label'] == '1']))
print('\n\nnegative casses:', len(valid_images_paths_XR_FINGER[valid_images_paths_XR_FINGER['label'] == '0']))