Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor corrections #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions just-pandas-things.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"\n",
"It's possible that Python wouldn't have become [the lingua franca of data science if it wasn't for pandas](https://stackoverflow.blog/2017/09/14/python-growing-quickly/). The package's exponential growth on Stack Overflow means two things:\n",
"1. It's getting increasingly popular.\n",
"2. It can be frustratinng to use sometimes (hence the high number of questions).\n",
"2. It can be frustrating to use sometimes (hence the high number of questions).\n",
"\n",
"This repo contains a few peculiar things I've learned about pandas that have made my life easier and my code faster. This post isn't a friendly tutorial for beginners, but a friendly introduction to pandas weirdness.\n",
"\n",
Expand Down Expand Up @@ -222,7 +222,7 @@
"\n",
"Before iterating over rows, think about what you want to do with each row, pack that into a function and use methods like `.apply()` to apply the function to all rows.\n",
"\n",
"For example, to scale the \"Experience\" column by the number of \"Upvotes\" each review has, one way is to iteratate over rows and multiple the \"Upvotes\" value by the \"Experience\" value of that row. But you can also use `.apply()` with a `lambda` function."
"For example, to scale the \"Experience\" column by the number of \"Upvotes\" each review has, one way is to iteratate over rows and multiply the \"Upvotes\" value by the \"Experience\" value of that row. But you can also use `.apply()` with a `lambda` function."
]
},
{
Expand Down Expand Up @@ -405,7 +405,7 @@
"- get row (row-based operation)\n",
"- get review (column-based operation)\n",
"\n",
"Get row -> get review is 25x slower than get review -> get row.\n",
"`get row -> get review` is 25x slower than `get review -> get row`.\n",
"\n",
"**Note**: You can also just use `df.loc[0, \"Review\"]` to calculate the memory address to retrieve the item. Its performance is comparable to get review then get row."
]
Expand Down Expand Up @@ -1546,7 +1546,7 @@
"Currently, our `DataFrame` has no labels yet. To create labels, use `.set_index()`.\n",
"\n",
"1. Labels can be integers or strings\n",
"2. A DatamFrame can have multiple labels"
"2. A DataFrame can have multiple labels"
]
},
{
Expand Down Expand Up @@ -3279,7 +3279,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## 6. Common pitfals\n",
"## 6. Common pitfalls\n",
"pandas is great for most day-to-day data analysis. It's instrumental to my job and I'm grateful that the entire pandas community is actively developing it. However, I think some of pandas design decisions are a bit questionable.\n",
"\n",
"Some of the common pandas pitfalls:\n",
Expand Down Expand Up @@ -3380,7 +3380,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.10"
"version": "3.8.3"
},
"varInspector": {
"cols": {
Expand Down