<jupyter_start><jupyter_text><jupyter_code>import pandas as pd
pd.plotting.register_matplotlib_converters()
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
print("Setup Complete")
batt_filepath = '../input/crystal-system-properties-for-liion-batteries/lithium-ion batteries.csv'

batt_data = pd.read_csv(batt_filepath, index_col='Materials Id')
#batt_data
#batt_data.head()
#batt_data.tail()
#batt_data.groupby('Formula').Formula.count()

#plt.figure(figsize=(20,5))
sns.swarmplot(x=batt_data['Crystal System'],
              y=batt_data['E Above Hull (eV)'])
plt.legend()
#plt.figure(figsize=(20,5))
sns.swarmplot(x=batt_data['Crystal System'],
              y=batt_data['Nsites'])
plt.legend()
#plt.figure(figsize=(20,5))
sns.swarmplot(x=batt_data['Has Bandstructure'],
              y=batt_data['Nsites'])
plt.legend()
#plt.figure(figsize=(20,5))
sns.swarmplot(x=batt_data['Has Bandstructure'],
              y=batt_data['Volume'])
plt.legend()
#plt.figure(figsize=(20,5))
sns.swarmplot(x=batt_data['Has Bandstructure'],
              y=batt_data['Density (gm/cc)'])
plt.legend()
#plt.figure(figsize=(20,5))
sns.swarmplot(x=batt_data['Has Bandstructure'],
              y=batt_data['Band Gap (eV)'])
plt.legend()
#plt.figure(figsize=(20,5))
sns.swarmplot(x=batt_data['Has Bandstructure'],
              y=batt_data['E Above Hull (eV)'])
plt.legend()
#plt.figure(figsize=(20,5))
sns.swarmplot(x=batt_data['Has Bandstructure'],
              y=batt_data['Formation Energy (eV)'])
plt.legend()
plt.figure(figsize=(30,5))
sns.lineplot(x=batt_data['Spacegroup'], y=batt_data['E Above Hull (eV)'], label='E Above Hull (eV)')
plt.legend()
plt.figure(figsize=(30,5))
sns.lineplot(x=batt_data['Spacegroup'], y=batt_data['Band Gap (eV)'], label='Band Gap (eV)')
plt.legend()
sns.distplot(a=batt_data['Formation Energy (eV)'], kde=False)
sns.kdeplot(data=batt_data['Volume'], shade=True)
sns.jointplot(x=batt_data['Volume'], 
              y=batt_data['Band Gap (eV)'], kind="kde")
sns.jointplot(x=batt_data['E Above Hull (eV)'], 
              y=batt_data['Band Gap (eV)'], kind="kde")
sns.scatterplot(x=batt_data['Nsites'], 
                y=batt_data['Volume'])
sns.regplot(x=batt_data['Nsites'], 
                y=batt_data['Volume'])
sns.lmplot(x='Nsites', 
           y='Volume',
           hue="Has Bandstructure", 
           data=batt_data)
sns.regplot(x=batt_data['Density (gm/cc)'], 
            y=batt_data['Volume'])
sns.lmplot(x='Density (gm/cc)', 
           y='Volume',
           hue="Has Bandstructure", 
           data=batt_data)
sns.scatterplot(x=batt_data['Nsites'], 
            y=batt_data['Volume'],
            hue=batt_data['Has Bandstructure'] )
sns.scatterplot(x=batt_data['Nsites'], 
            y=batt_data['Volume'],
            hue=batt_data['Crystal System'])
# Selection
#batt_selected = batt_data.loc[:, ['Formation Energy (eV)', 'Band Gap (eV)', 'Density (gm/cc)']]
batt_selected = batt_data.loc[:, ['Formation Energy (eV)']]

batt_data.index.value_counts()
batt_data['Crystal System'].value_counts()
batt_data['Spacegroup'].value_counts()
batt_data['Formula'].value_counts()
sns.heatmap(data=batt_selected, annot=True)
batt_selected.head()
#batt_data.columns
batt_data.head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18301655426118946, 'fraction_numerical': 0.009196811771919068, 'mean_word_length': 4.7752212389380535, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '621769', 'license': 'MIT', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1249, 'n_words': 170, 'path': 'analysis-of-li-ion-batteries.ipynb', 'repo_name': 'tuanvo-git/deep-learning-assb', 'size': '3262'}