-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[Folder 2 - Lesson 7 - notebook-covidspread] fix incorrect indexing #724
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
base: main
Are you sure you want to change the base?
[Folder 2 - Lesson 7 - notebook-covidspread] fix incorrect indexing #724
Conversation
… [2:] to [3:] to drop the correct columns and dropped the province column to ensure the function works properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request fixes incorrect data slicing in a COVID-19 spread analysis notebook that was causing non-date metadata to appear in plots. The fix adjusts the slice indexing from [2:] to [3:] to properly exclude Province/State, Latitude, and Longitude columns, and adds Province/State to the list of columns to be dropped.
Changes:
- Updated data slicing from [2:] to [3:] to exclude three metadata columns instead of two
- Added 'Province/State' column to the drop list alongside 'Lat' and 'Long' for all three dataframes
- Removed trailing whitespace in the mkframe function
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "metadata": {}, | ||
| "source": [ | ||
| "> **Note** how we use `[2:]` to remove first two elements of a sequence that contain geolocation of a country. We can also drop those two columns altogether:" | ||
| "> **Note** how we use `[3:]` to remove first three elements of a sequence that contain geolocation of a country. We can also drop those three columns altogether:" |
Copilot
AI
Jan 16, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation states 'geolocation of a country' but actually the three columns include 'Province/State', 'Lat', and 'Long'. Only two of these (Lat/Long) are geolocation data. The description should be updated to accurately describe all three columns being removed, e.g., 'metadata columns (Province/State and geolocation)' or 'non-date metadata'.
| "> **Note** how we use `[3:]` to remove first three elements of a sequence that contain geolocation of a country. We can also drop those three columns altogether:" | |
| "> **Note** how we use `[3:]` to remove the first three elements of a sequence that contain non-date metadata (the Province/State and geolocation columns). We can also drop those three columns altogether:" |
… entries
Update the slicing of the series from [2:] to [3:] because indexes 0-2 contains non-date metadata (province, latitude, longitude). The label "longitude" is included in the dataframe and appears in the plot. Additionally, drop the column "province/state" column before the function is called. This is because "province/state" contains non-date data that will cause an error when the function is called.