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

Starter Kit #1290

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
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
34 changes: 29 additions & 5 deletions starter_kit/2024_basics_01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"source": [
"## Import Packages\n",
"* Before doing some data cleaning and analyzing, we need to equip ourselves with the right tools.\n",
"* Part of our \"toolbox\" are importing packages. \n",
"* Part of our \"toolbox\" packages that you `import` into your notebook.\n",
"* **Resource**: [Importing Dependencies via Practical Python for Data Science](https://www.practicalpythonfordatascience.com/05_data_exploration.html?highlight=dependencies#importing-our-dependencies)\n",
"\n",
"### `Pandas`\n",
Expand Down Expand Up @@ -107,7 +107,7 @@
" * You can check out all the functions [here](https://github.com/cal-itp/data-infra/tree/main/packages/calitp-data-analysis/calitp_data_analysis).\n",
"* Below, we are importing only one function called `to_snakecase` from the python submodule `sql` in our package `calitp_data_analysis`. \n",
"* `to_snakecase` allows us to change the column names of our dataset from something like `Project Description` to `project_description`. \n",
" * Turning the column names to lower case and replacing the spaces with underscores, this makes referencing specific columns much easier."
" * Turning the column names to lower case and replacing the spaces with underscores makes referencing specific columns much easier."
]
},
{
Expand All @@ -131,7 +131,7 @@
"* Take some time to get used to this interface. \n",
" * Press ctrl+enter to run a cell\n",
" * Go up to the Kernel and rerun all the cells.\n",
" * Use the scissors at the top to cut out the cell.\n",
" * Use the scissors at the top to delete out the cell.\n",
" * Adjust your settings to be dark instead of light.\n",
"* There are many tutorials available on Youtube, just skip the installation portion. \n",
" * [This one looks promising](https://youtu.be/LW2Rye_l8L0?si=B8kojobCe3OIF3xg)."
Expand Down Expand Up @@ -474,6 +474,30 @@
"* Use the function `to_snakecase` to clean up your column names"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e36a71fc-6548-4d3e-98ae-6068606a9f4b",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "7a0e6a7e-94cc-4720-b8de-4e952f707e1d",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "d390b328-ae12-4760-a0d6-e20532a2c891",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "cd0d51ea-b7da-41d0-bb03-5432b4de1a1b",
Expand Down Expand Up @@ -658,7 +682,7 @@
"outputs": [],
"source": [
"\n",
"scores_df[[\"project_name\",\"overall_score\"]].to_excel(f\"{GCS_FILE_PATH}{FILE}\")"
"df.to_excel(f\"{GCS_FILE_PATH}{FILE}\")"
]
},
{
Expand Down Expand Up @@ -687,7 +711,7 @@
" * The `mv` stands for move, and renaming a file is basically \"moving\" its path. \n",
" * If you rename directly with right click, rename, you destroy the git history.\n",
" * Doing it this way retains the git history associated with the notebook.\n",
"* In the terminal, paste `your_new_notebook.ipynb`. \n",
"* In the terminal, paste `git add your_new_notebook.ipynb`. \n",
" * This adds your new notebook.\n",
" * To add all files with a certain extension, write `git add *ipynb`.\n",
"* Continuing in the terminal, paste `git commit -m 'write a message here'`\n",
Expand Down
16 changes: 16 additions & 0 deletions starter_kit/2024_basics_03.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,22 @@
"* Write an if-else and set the various percentiles using variables. "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6a10cf89-0997-465d-a3d9-f1464e6c619f",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "8121275c-a4fa-44d8-861e-4fd6accba0e4",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "d91c41b1-76c4-4673-b16f-ef9990d66270",
Expand Down
Loading