"Pandas is a python library used to analyze data."
]
},
{
"cell_type": "markdown",
"id": "2b78245b",
"metadata": {},
"source": [
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "71e867d9",
"metadata": {},
"source": [
"## Description\n",
"Pandas take tabular data and store them in objects known as ‘databases’. They are useful for exploring, cleaning, and processing data\n"
]
},
{
"cell_type": "markdown",
"id": "58ec20e8",
"metadata": {},
"source": [
"## Self Assessment\n",
"\n",
"Questions that test for the learning goals and allows students to evaluate if they truly understand the topics."
]
},
{
"cell_type": "markdown",
"id": "5d237ca9",
"metadata": {},
"source": [
"## Training Materials\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "21f9b14e",
"metadata": {},
"source": [
"For a general understanding of how to use pandas, along with practice exercises, check out the following website: https://www.w3schools.com/python/pandas/default.asp\n",
"\n",
"For a complete directory of everything you can do with pandas:\n",
"✅ **<span style=\"color:red\">Question:</span>** Sort the data by student’s SSN. Store this data in a new dataframe called df_3.\n",
"\n",
"\n",
"If you need help: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sort_values.html?highlight=sort_values#pandas.DataFrame.sort_values\n",
"\u001b[0;31mNameError\u001b[0m: name 'pd' is not defined"
]
}
],
"source": [
"##ANSWER##\n",
"df_3 = df_2.sortvalues(by='Final')\n",
"\tdf_3 \n",
"\n",
"\n",
"\n",
"##ANSWER##"
]
},
{
"cell_type": "markdown",
"id": "11a12621",
"metadata": {},
"source": [
"✅ **<span style=\"color:red\">Question:</span>** Sort the data by the overall letter grade they received in the class and the grade they received on the final.\n",
"\n",
"\n",
"If you need help: Same as above\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "333f476e",
"metadata": {},
"source": [
"✅ **<span style=\"color:red\">Question:</span>** Create a line graph plotting Test 1 scores against Test 2 scores.\n",
"\n",
"\n",
"\n",
"If you need help: https://pandas.pydata.org/docs/user_guide/visualization.html\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "f66f2294",
"metadata": {},
"source": [
"✅ **<span style=\"color:red\">Question:</span>** Perform a correlation test comparing Test 3 and Test 4 scores.\n",
"\n",
"\n",
"If you need help: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.corr.html\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "dd9c7fa5",
"metadata": {},
"source": [
"✅ **<span style=\"color:red\">Question:</span>** Example answercheck question: What is $x = 2+2$?\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "64684dfd",
"metadata": {},
"outputs": [],
"source": [
"#Put your answer here"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "619a2259",
"metadata": {},
"outputs": [],
"source": [
"##ANSWER##\n",
"x = 4\n",
"##ANSWER##"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "9cc2b34a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"CheckWarning: passed variable is <class 'int'> and not a numpy.matrix.\n",
" Trying to convert to a array matrix using ```A = np.matrix(A)```.\n",
"\n",
"\n",
"CheckWarning: passed matrix is int64 and not <class 'numpy.float64'>...\n",
" Trying to convert to float using ```A = A.astype(float)```.\n",
"Written by <<YOUR NAME HERE>>, Michigan State University \n",
"As part of the Data Science Bridge Project \n",
" \n",
"<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc/4.0/\"><img alt=\"Creative Commons License\" style=\"border-width:0\" src=\"https://i.creativecommons.org/l/by-nc/4.0/88x31.png\" /></a><br />This work is licensed under a <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc/4.0/\">Creative Commons Attribution-NonCommercial 4.0 International License</a>."
('answercheck.py', <http.client.HTTPMessage at 0x7fc9a8612220>)
%% Cell type:markdown id:3c2a4f39 tags:
# Pandas
Pandas is a python library used to analyze data.
%% Cell type:markdown id:2b78245b tags:

%% Cell type:markdown id:71e867d9 tags:
## Description
Pandas take tabular data and store them in objects known as ‘databases’. They are useful for exploring, cleaning, and processing data
%% Cell type:markdown id:58ec20e8 tags:
## Self Assessment
Questions that test for the learning goals and allows students to evaluate if they truly understand the topics.
%% Cell type:markdown id:5d237ca9 tags:
## Training Materials
%% Cell type:markdown id:21f9b14e tags:
For a general understanding of how to use pandas, along with practice exercises, check out the following website: https://www.w3schools.com/python/pandas/default.asp
For a complete directory of everything you can do with pandas:
✅**<span style="color:red">Question:</span>** Sort the data by student’s SSN. Store this data in a new dataframe called df_3.
If you need help: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sort_values.html?highlight=sort_values#pandas.DataFrame.sort_values
✅**<span style="color:red">Question:</span>** Sort the data by the overall letter grade they received in the class and the grade they received on the final.
If you need help: Same as above
%% Cell type:markdown id:333f476e tags:
✅**<span style="color:red">Question:</span>** Create a line graph plotting Test 1 scores against Test 2 scores.
If you need help: https://pandas.pydata.org/docs/user_guide/visualization.html
%% Cell type:markdown id:f66f2294 tags:
✅**<span style="color:red">Question:</span>** Perform a correlation test comparing Test 3 and Test 4 scores.
If you need help: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.corr.html
%% Cell type:markdown id:dd9c7fa5 tags:
✅**<span style="color:red">Question:</span>** Example answercheck question: What is $x = 2+2$?
CheckWarning: passed variable is <class 'int'> and not a numpy.matrix.
Trying to convert to a array matrix using ```A = np.matrix(A)```.
CheckWarning: passed matrix is int64 and not <class 'numpy.float64'>...
Trying to convert to float using ```A = A.astype(float)```.
Testing [[4.]]
Answer seems to be correct
%% Cell type:markdown id:44b461a0 tags:
---
Written by <<YOURNAMEHERE>>, Michigan State University
As part of the Data Science Bridge Project
<arel="license"href="http://creativecommons.org/licenses/by-nc/4.0/"><imgalt="Creative Commons License"style="border-width:0"src="https://i.creativecommons.org/l/by-nc/4.0/88x31.png"/></a><br/>This work is licensed under a <arel="license"href="http://creativecommons.org/licenses/by-nc/4.0/">Creative Commons Attribution-NonCommercial 4.0 International License</a>.