diff --git a/Lecture4.ipynb b/Lecture4.ipynb index f3bdc58..76d851a 100644 --- a/Lecture4.ipynb +++ b/Lecture4.ipynb @@ -298,7 +298,7 @@ "\n", "* a band gap between 0.5 and 1.5 eV: `band_gap=(0.5,1.5)`\n", "* two elements: `num_elements=(2,3)`\n", - "* contains oxygen: `elements=[\"O\"]`\n", + "* contains lithium: `elements=[\"Li\"]`\n", "\n", "We want to return the following properties: `material_id`,`formula_pretty` ,`band_gap`, `theoretical`, `is_stable`." ] @@ -333,16 +333,16 @@ }, "outputs": [], "source": [ - "# Query for binary and ternary oxides\n", + "# Query for binary and ternary Li compounds with compact output\n", "with MPRester(FBI_KEY, use_document_model=False) as mpr:\n", " docs = mpr.materials.summary.search(\n", - " elements=[\"O\"],\n", + " elements=[\"Li\"],\n", " band_gap=(0.5,1.5),\n", " num_elements=(2,3),\n", " fields=['material_id', 'formula_pretty','band_gap','is_stable', 'theoretical']\n", " )\n", "\n", - "print(\"Number of binary and ternary oxides with band gap between 0.5 and 1.5 eV: \", len(docs))" + "print(\"Number of binary and ternary Li containing compounds with a band gap between 0.5 and 1.5 eV: \", len(docs))" ] }, { @@ -513,7 +513,7 @@ "source": [ "We now have a DataFrame with the properties that we requested. However, the symmetry is still in dictionary form. This type of issue arises many times in data pre-processing for machine learning models.\n", "\n", - "The `symmetry` property contains key value pairs of the symmetry data: `number`, `symbol`, `crystal_system`, `point_group`, `source`, `version`. With the exception of `number`, these are all currently `None` as we only requested the property `symmetry.number`. We can convert the `symmetry` into a column of the DataFrame using `.apply()`. This method applies a function to each row of the DataFrame. In this case, we will apply a function that returns the value of the `number` key of the `symmetry` dictionary. " + "The `symmetry` property contains key value pairs of the symmetry data. We can convert the `symmetry` into a column of the DataFrame using `.apply()`. This method applies a function to each row of the DataFrame. In this case, we will apply a function that returns the value of the `number` key of the `symmetry` dictionary. " ] }, { @@ -540,13 +540,13 @@ " \"\"\"\n", " return symmetry[\"number\"]\n", "\n", - "# Apply the function to each row of the dataframe\n", + "# Apply the function to each row of the DataFrame\n", "oxide_df[\"symmetry.number\"] = oxide_df[\"symmetry\"].apply(get_spacegroup_number)\n", "\n", - "# Drop the \"symmetry\" column from the dataframe\n", + "# Drop the \"symmetry\" column from the DataFrame\n", "oxide_df.drop(columns=[\"symmetry\"], inplace=True)\n", "\n", - "# Display the first few rows of the dataframe\n", + "# Display the first few rows of the DataFrame\n", "oxide_df.head()" ] },