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

Update python cookbook #55

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

alifiarahmah
Copy link

Description

Deprecation fixes and ensure relevance with updated dataset from external url

Changes

  • Change pd.set_option('display.mpl_style', 'default') to use plt.style.use('default') in all chapters (cd86aa3) for deprecation fixes

  • Match chapter5.md (4c083be) and chapter6.md (193282e) code to ensure its continued relevance with the updated dataset in external url

  • Deprecation fixes in chapter6.md (193282e) and chapter7.md (603846b)

….use('default')

pd.set_option('display.mpl_style', 'default') is deprecated. Changed with plt.style.use('default')
The dataset in url seems updated, so the code in guide is modified so it is still relevant to the updated dataset
- Update the code to match updated datasets
- Changed resample from .resample('M').apply(np.median) to .resample('ME').apply('median') (same as means) for deprecation fixes
- Change pd.set_option('display.width', 5000) to pd.set_option('display.width', 5000) for deprecation fix
- Use requests.loc to replace requests['Incident Zip'] with value '00000' with np.nan for addressing pandas copy warnings
- Delete unique_zips.sort() because of error sorting array of strings and nan
- Add .dropna()
- Change .sort() to sort_values()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant