Section 1 Homework#

This is the homework for the first session of the MolSSI Python Scripting Level 2 Workshop. This homework is intended to give you practice with the material covered in the first session.

Goals:

  • Utilize pandas to read in and work with the data in a csv file.

  • Utilize matplotlib to create plots and subplots of data stored in a pandas dataframe.

  • Utilize pandas to extract specific information from a dataframe.

  • Utilize matplotlib to construct a plot with multiple groups of data.

For this homework, you will use the file PubChemElements_all.csv. This file contains information about elements of the periodic table. If you took MolSSI’s level 1 Python scripting course, you will recognize this data file from the pandas lesson.

For this homework, you will be exploring this data file using pandas and creating some plots using matplotlib.

Exercise 1#

Using the PubChemElements_all.csv file, create a plot of the Ionization Energy trend of the periodic table. The trend can be visualized by plotting the Ionization Energy of each element against it’s Atomic Number.

Exercise 2#

Create a pair of subplots comparing the Ionization Energy and Electronegativity trends. The Electronegativity trend can be plotted in the same way as the Ionization Energy, by plotting the Electronegativity of each element against it’s Atomic Number.

Exercise 3#

Create a function that will assign a color coding to a particular Standard State of an element, i.e. red for gases, blue for solids, etc. Use the appropriate function from pandas to apply your function across the periodic table, creating a column of assigned colors. Create a pair of subplots utilizing the assigned color as the color of the marker:

  • Atomic Mass against the Melting point of each element

  • Ionization Energy against the Melting Point of each element

Hint: You will need to figure out all of the standard states listed in the periodic table. See if you can figureout a pandas function which will tell you all of the unique values in a column.