0% found this document useful (0 votes)
9 views2 pages

THO11

Uploaded by

radjvirasomai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

THO11

Uploaded by

radjvirasomai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Example 1:

import matplotlib.pyplot as plt

import pandas as pd

df = pd.read_csv('Periodic table of elements.csv')

boiling_points = df['BoilingPoint']

melting_points = df['MeltingPoint']

delta_values = boiling_points - melting_points

plt.xticks([0, 25, 50, 75, 100])

plt.yticks([0, 1000, 2000, 3000, 4000])

plt.plot(df['AtomicNumber'], delta_values, label='Delta Boiling/Melting Points', c='red')

plt.xlabel("Atomic Numbers")

plt.ylabel("Delta Boiling point and Melting point")

plt.title("Atoms: Melting point - Boiling point difference")

plt.legend()

plt.show()

df['DeltaBoilingMelting'] = delta_values

df.to_csv('Periodic table updated.csv', index=False)

Example 2:

import pandas as pd
df = pd.read_csv('Scores.csv')

new_row_1 = {'student': 'Example G', 'score': 6.5}

new_row_2 = {'student': 'Example H', 'score': 8.9}

df = pd.concat([df, pd.DataFrame([new_row_1])], ignore_index=True)

df = pd.concat([df, pd.DataFrame([new_row_2])], ignore_index=True)

df['Passed the class'] = df['score'] >= 5.5

df.to_csv('Scores.csv', index=False)

You might also like