<jupyter_start><jupyter_text>Heading<jupyter_code>df = pd.read_excel('3R COVER DEFECTS.xlsx')
df['Tunnel/Viaduct'] = df['Tunnel/Viaduct'].fillna('Viaduct')
df.head()<jupyter_output><empty_output><jupyter_text>Heading 2<jupyter_code>colors = list(
    df['Tunnel/Viaduct'].replace({'Viaduct': 'blue', 'Tunnel': 'brown'}))
sectors = list(df['TrackSector'])
#for index in range(0,len(sectors)):
#    if index%2 ==0:
#        sectors[index] = ''
# create a dataset
count = df['Defect Count']
x_pos = np.arange(len(sectors))

# Create title and labels
plt.title('3R Cover Defects in NSEWL (2018-2020)', fontsize=30)
plt.xlabel('Sectors', fontsize=15)
plt.ylabel('Defect Count', fontsize=15)

# Create bars with different colors
plt.bar(x_pos, count, color=colors)

# Create names on the x-axis
plt.xticks(x_pos, sectors, rotation=90, fontsize=10)

# Create legend
legend_colors = {'Viaduct': 'blue', 'Tunnel': 'brown'}
labels = list(legend_colors.keys())
handles = [
    plt.Rectangle((0, 0), 1, 1, color=legend_colors[label]) for label in labels
]
plt.legend(handles, labels, prop={'size': 15})

# Show graph
plt.rcParams["figure.figsize"] = (30, 30)
plt.show()<jupyter_output><empty_output><jupyter_text>Sub-heading 2<jupyter_code>df = pd.read_excel('3R Nylon Bolt Defects.xlsx')
df['Tunnel/Viaduct'] = df['Tunnel/Viaduct'].fillna('Viaduct')
df = df.sort_values(by=['Defect Count'], ascending=[False])
colors = list(df['Tunnel/Viaduct'].replace({
    'Viaduct': 'blue',
    'Tunnel': 'brown'
}))
sectors = list(df['TrackSector'])
# create a dataset
count = df['Defect Count']
x_pos = np.arange(len(sectors))

# Create title and labels
plt.title('3R Nylon Bolt Defects in NSEWL (2018-2020)', fontsize=30)
plt.xlabel('Sectors', fontsize=15)
plt.ylabel('Defect Count', fontsize=15)

# Create bars with different colors
plt.bar(x_pos, count, color=colors)

# Create names on the x-axis
plt.xticks(x_pos, sectors, rotation=90, fontsize=10)

# Create legend
legend_colors = {'Viaduct': 'blue', 'Tunnel': 'brown'}
labels = list(legend_colors.keys())
handles = [
    plt.Rectangle((0, 0), 1, 1, color=legend_colors[label]) for label in labels
]
plt.legend(handles, labels, prop={'size': 15})

# Show graph
plt.rcParams["figure.figsize"] = (30, 30)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17523056653491437, 'fraction_numerical': 0.02854633289415898, 'mean_word_length': 6.348387096774194, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '93449', 'license': 'MIT', 'n_tokens_mistral': 938, 'n_tokens_neox': 870, 'n_words': 183, 'path': '3R Data Analysis2.ipynb', 'repo_name': 'jooern81/binder_test', 'size': '2277'}