This data came from Penn State CS professor Doug Hogan.
Thanks to UCF undergraduates Sam Borges, for finding the data set, and Lissa Galguera, for formatting it.
In [1]:
# Import modules that contain functions we need
import pandas as pd
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
In [2]:
# Read in data that will be used for the calculations.
# The data needs to be in the same directory(folder) as the program
# Using pandas read_csv method, we can create a data frame
data = pd.read_csv("./data/elements.csv")
# If you're not using a Binder link, you can get the data with this instead:
#data = pd.read_csv("http://php.scripts.psu.edu/djh300/cmpsc221/pt-data1.csv")"
In [3]:
# displays the first several rows of the data set
data.head()
Out[3]:
In [4]:
# the names of all the columns in the dataset
data.columns
Out[4]:
In [5]:
ax = data.plot('Atomic Number', 'Atomic Radius (pm)', title="Atomic Radius vs. Atomic Number", legend=False)
ax.set(xlabel="x label", ylabel="y label")
Out[5]:
In [6]:
data.plot('Atomic Number', 'Mass')
Out[6]:
In [7]:
data[['Name', 'Year Discovered']].sort_values(by='Year Discovered')
Out[7]:
In [ ]: