Skip to content

Commit

Permalink
More edits to scipy.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
nwhitsett committed Jan 21, 2025
1 parent 2dd7237 commit b16d2cf
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion ExoCore/Curriculum/Data_Structures/Scipy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,39 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"You can find a list of available units [here](https://docs.scipy.org/doc/scipy-1.15.0/reference/constants.html). All units are reported in [SI units](https://en.wikipedia.org/wiki/International_System_of_Units#:~:text=The%20SI%20comprises%20a%20coherent,candela%20(cd%2C%20luminous%20intensity))."
"You can find a list of available units [here](https://docs.scipy.org/doc/scipy-1.15.0/reference/constants.html). All units are reported in [SI units](https://en.wikipedia.org/wiki/International_System_of_Units#:~:text=The%20SI%20comprises%20a%20coherent,candela%20(cd%2C%20luminous%20intensity)).\n",
"\n",
"### Constants Database\n",
"In addition to the built-in constants above, SciPy has integrated an API that allows user to query the [CODATA 2022](https://arxiv.org/abs/2409.03787) constants catalog. This can be navigated using the `value(key)`, `unit(key)`, `precision(key)` and `find([substring, disp])`:"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"standard acceleration of gravity\n",
"The value of g is: 9.80665\n",
"The units of g are: m s^-2\n",
"The uncertainty of g is: 0.0\n"
]
}
],
"source": [
"## We want to know the standard acceleration due to gravity\n",
"a = scipy.constants.find(\"gravity\", True)\n",
"\n",
"## Value and units\n",
"\n",
"g = scipy.constants.physical_constants['standard acceleration of gravity']\n",
"\n",
"print(\"The value of g is: \" + str(g[0]))\n",
"print(\"The units of g are: \" + str(g[1]))\n",
"print(\"The uncertainty of g is: \" + str(g[2]))"
]
}
],
Expand Down

0 comments on commit b16d2cf

Please sign in to comment.