image_output_5.png image_output_7.png image_output_4.png image_output_8.png image_output_6.png image_output_3.png image_output_2.png image_output_1.png
import numpy as np # linear algebra

import os

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

import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
import os
data_dir = '../input/champs-scalar-coupling' if 'champs-scalar-coupling' in os.listdir('../input/') else '../input'

train = pd.read_csv(f'{data_dir}/train.csv')
test = pd.read_csv(f'{data_dir}/test.csv')
sub = pd.read_csv(f'{data_dir}/sample_submission.csv')
structures = pd.read_csv(f'{data_dir}/structures.csv')

are_the_same_types = np.all(sorted(train['type'].unique()) == sorted(test['type'].unique()))

for type_ in np.unique(train['type']):
    ix = train['type'] == type_
    fig, axes = plt.subplots(2, 2, figsize=(12, 4))
    axes = axes.flatten()
    _ = axes[0].hist(x=train['atom_index_0'][ix], bins=50)
    _ = axes[1].hist(x=test['atom_index_0'][ix], bins=50)
    _ = axes[2].hist(x=train['atom_index_1'][ix], bins=50)
    _ = axes[3].hist(x=test['atom_index_1'][ix], bins=50)
    axes[0].set(xlabel='count', ylabel='atom_index_0', title=f'{type_}, train')
    axes[1].set(xlabel='count', ylabel='atom_index_0', title=f'{type_}, test')
    axes[2].set(xlabel='count', ylabel='atom_index_1', title=f'{type_}, train')
    axes[3].set(xlabel='count', ylabel='atom_index_1', title=f'{type_}, test')
    fig.tight_layout()