You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

214 lines
4.0 KiB

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img src=\"http://imgur.com/1ZcRyrc.png\" style=\"float: left; margin: 20px; height: 55px\">\n",
"\n",
"## Homework: Intro to Pandas\n",
"\n",
"_Author: Kevin Coyle (L.A.)_\n",
"\n",
"---\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Welcome!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Pandas: Intro Practice Problems\n",
"\n",
"In this homework, you're going to write code for a few problems. \n",
"\n",
"You'll be practicing these programming concepts we've covered in class:\n",
"* Reading data sets into Pandas.\n",
"* Filtering, manipulating, and sorting data sets.\n",
"* Basic exploratory data analysis with Pandas."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### #1. Import Pandas with an alias of `pd`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### #2. Read in the NBA players `csv` into a variable called `nba_df`."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is a data set of NBA players from 2015. The filename is `NBA_players_2015.csv`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### #3. Look at the first five rows of the data set."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### #4. Check out the shape of the data set."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### #5. Run some summary stats on the data set with the `describe()` function."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### #6. Sort the data set in on the `players` column in alphabetical order."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### #7. Filter the data set. Create three sub DataFrames from the `position` column for `G`, `F`, and `C`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### #8. Run `describe()` on these new DataFrames. Compare the mean field goals (the `fg` column) between positions."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The end!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Great job!"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}