text_html_output_1.png image_output_1.png
import pandas as pd

import seaborn as sns

root_dir = '../input/rsna-miccai-voxel-64-dataset/'
df = pd.read_csv('../input/training-labels/train_labels.csv')
sns.countplot(data=df, x='MGMT_value')
def full_ids(data):
    zeros = 5 - len(str(data))
    if zeros > 0:
        prefix = ''.join(['0' for i in range(zeros)])
    return prefix + str(data)
df['BraTS21ID_full'] = df['BraTS21ID'].apply(full_ids)
df['flair'] = df['BraTS21ID_full'].apply(lambda file_id: root_dir + 'train/' + file_id + '/FLAIR/')
df['t1w'] = df['BraTS21ID_full'].apply(lambda file_id: root_dir + 'train/' + file_id + '/T1w/')
df['t1wce'] = df['BraTS21ID_full'].apply(lambda file_id: root_dir + 'train/' + file_id + '/T1wCE/')
df['t2w'] = df['BraTS21ID_full'].apply(lambda file_id: root_dir + 'train/' + file_id + '/T2w/')
df
to_exclude = [109, 123, 709]
df = df[~df['BraTS21ID'].isin(to_exclude)]
df = df.reset_index(drop=True)
df2 = pd.read_csv('../input/exportdataframe/export_dataframe.csv')
df = pd.concat([df, df2[['flair_axis', 't1w_axis', 't1wce_axis', 't2w_axis']]], axis=1, join='inner')
df