pandas DataFrame, and
plot summaries of the data (including layup information) using matplotlib and seaborn.
Get data from Granta MI
Connect to Granta MI and specify a database.Use DataFrames to pre-process and append the data
Build a separate DataFrame for each table
Create a DataFrame for each Granta MI table. The DataFrames are built from two separate lists of dictionaries:pedigree_df that contains the pedigree records. Set the DataFrame index to be the Panel number
attribute value
and sort by the index.
| Ply count | Panel thickness, average (measured) | Ply thickness, average (measured) | |
|---|---|---|---|
| Panel number | |||
| LBJ13 | 6 | 1.397000 | 0.232029 |
| LBJ14 | 6 | 1.431636 | 0.238044 |
| LBJ42 | 6 | 1.438564 | 0.240007 |
| LBJ53 | 6 | 1.385455 | 0.231279 |
| LBJ62 | 6 | 1.410677 | 0.234618 |
tensile_df that contains the tensile test results. Again, set the index to be the
Panel number attribute value and sort by both the index and the Specimen ID.
| Specimen ID | Young’s Modulus (11-axis) | Ultimate Tensile Strength | Test Type | |
|---|---|---|---|---|
| Panel number | ||||
| LBJ13 | LBJ1311A | 47.594514 | 1582.870937 | 0° tension |
| LBJ13 | LBJ1312A | 47.353197 | 1542.122918 | 0° tension |
| LBJ13 | LBJ1313A | 47.387671 | 1612.952766 | 0° tension |
| LBJ14 | LBJ1413A | NaN | 1613.614663 | 0° tension |
| LBJ14 | LBJ1415A | NaN | 1611.201497 | 0° tension |
Join the dataframes
Use thedataframe.join() method to create a DataFrame with both sets of data. The join type will default to a
left-join if not specified; this is fine in our case because the records were linked via a smart link in Granta MI,
and so the set of indices is the same for both DataFrames.
| Ply count | Panel thickness, average (measured) | Ply thickness, average (measured) | Specimen ID | Young’s Modulus (11-axis) | Ultimate Tensile Strength | Test Type | |
|---|---|---|---|---|---|---|---|
| Panel number | |||||||
| LBJ13 | 6 | 1.397000 | 0.232029 | LBJ1311A | 47.594514 | 1582.870937 | 0° tension |
| LBJ13 | 6 | 1.397000 | 0.232029 | LBJ1312A | 47.353197 | 1542.122918 | 0° tension |
| LBJ13 | 6 | 1.397000 | 0.232029 | LBJ1313A | 47.387671 | 1612.952766 | 0° tension |
| LBJ14 | 6 | 1.431636 | 0.238044 | LBJ1413A | NaN | 1613.614663 | 0° tension |
| LBJ14 | 6 | 1.431636 | 0.238044 | LBJ1415A | NaN | 1611.201497 | 0° tension |
units dict so you can create plots with meaningful axis labels.
Plot the data
This code snippet is optional, and is included to increase the size of all plots generated in this notebook.Investigate the relationship between two properties
Create a scatter plot withmatplotlib comparing Ultimate Tensile Strength of the panels to
Ply thickness, average.

Investigate the impact of other properties
First, examine the underlying data; use theDataFrame.describe() method to view a statistical summary of the data in
each column.
| Ply count | Panel thickness, average (measured) | Ply thickness, average (measured) | Specimen ID | Young’s Modulus (11-axis) | Ultimate Tensile Strength | Test Type | |
|---|---|---|---|---|---|---|---|
| count | 67.000000 | 67.000000 | 67.000000 | 67 | 18.000000 | 67.000000 | 67 |
| unique | NaN | NaN | NaN | 67 | NaN | NaN | 2 |
| top | NaN | NaN | NaN | LBJ1311A | NaN | NaN | 0° tension |
| freq | NaN | NaN | NaN | 1 | NaN | NaN | 56 |
| mean | 6.492537 | 1.534167 | 0.235604 | NaN | 42.775844 | 1288.110261 | NaN |
| std | 1.119701 | 0.294450 | 0.005039 | NaN | 13.523385 | 557.743977 | NaN |
| min | 6.000000 | 1.379415 | 0.229948 | NaN | 13.217251 | 44.629768 | NaN |
| 25% | 6.000000 | 1.385455 | 0.231279 | NaN | 47.022249 | 1353.613343 | NaN |
| 50% | 6.000000 | 1.410677 | 0.234618 | NaN | 47.973725 | 1545.653034 | NaN |
| 75% | 6.000000 | 1.438564 | 0.240007 | NaN | 49.364743 | 1603.610369 | NaN |
| max | 9.000000 | 2.213429 | 0.245727 | NaN | 51.400420 | 1639.559637 | NaN |
DataFrame["Test Type"].unique().

.twinx() to plot them on a separate y-axis.
