Skip to content

Improve pandas code and formatting#468

Closed
deppen8 wants to merge 1 commit intodatacarpentry:gh-pagesfrom
deppen8:patch-2
Closed

Improve pandas code and formatting#468
deppen8 wants to merge 1 commit intodatacarpentry:gh-pagesfrom
deppen8:patch-2

Conversation

@deppen8
Copy link
Copy Markdown
Contributor

@deppen8 deppen8 commented Jun 23, 2020

  • Add lots of code style formatting where appropriate
  • Replace references to isnull() with isna(). These methods are exactly the same for pandas, but isna() is consistent with fillna, dropna, etc.
  • Replace a reference to merged_left.genus with merged_left['genus'], the preferred notation style for pandas
  • Add more consistent use of {: .output} formatting
  • Remove u'string' notation, which is a Python 2.x leftover, to match what learners will see with Python 3.x

Please delete this line and the text below before submitting your contribution.


Thanks for contributing! If this contribution is for instructor training, please send an email to checkout@carpentries.org with a link to this contribution so we can record your progress. You’ve completed your contribution step for instructor checkout just by submitting this contribution.

Please keep in mind that lesson maintainers are volunteers and it may be some time before they can respond to your contribution. Although not all contributions can be incorporated into the lesson materials, we appreciate your time and effort to improve the curriculum. If you have any questions about the lesson maintenance process or would like to volunteer your time as a contribution reviewer, please contact The Carpentries Team at team@carpentries.org.


- Add lots of code style formatting where appropriate
- Replace references to isnull() with isna(). These methods are exactly the same for pandas, but isna() is consistent with fillna, dropna, etc.
- Replace a reference to `merged_left.genus` with `merged_left['genus']`, the preferred notation style for pandas
- Add more consistent use of `{: .output}` formatting
- Remove `u'string'` notation, which is a Python 2.x leftover, to match what learners will see with Python 3.x
maxim-belkin added a commit to maxim-belkin/python-ecology-lesson that referenced this pull request Jul 22, 2020
@maxim-belkin
Copy link
Copy Markdown
Contributor

Thank you, Jacob! Great work! I like the changes you suggest. I'm not 100% sure about the proper formatting for pandas. When we use back ticks we usually talk about code or something we type. Here, pandas is neither but a package name. How about we keep pandas "as was" for now and discuss this change in a separate PR (if you think we should do something to its style)?

@maxim-belkin maxim-belkin added the type:enhancement Propose enhancement to the lesson label Jul 23, 2020
@tobyhodges
Copy link
Copy Markdown
Member

See my comment on #467, about pandas vs pandas. As I said there, if you would like to address Maxim's comments here, and adjust the PR to style "pandas" according to this principle, please go ahead and do so, @deppen8. (Note that you will first need to resolve the conflicts that have been introduced.) I will circle back to this one in a few weeks and make the necessary changes before merging otherwise.

@tobyhodges
Copy link
Copy Markdown
Member

Superseded by #541

@tobyhodges tobyhodges closed this Apr 25, 2023
zkamvar pushed a commit that referenced this pull request May 8, 2023
…das" with backticks.

- Add lots of code style formatting where appropriate
- Replace references to isnull() with isna(). These methods are exactly the same for pandas, but isna() is consistent with fillna, dropna, etc.
- Replace a reference to merged_left.genus with merged_left['genus'], the preferred notation style for pandas
- Add more consistent use of {: .output} formatting
- Remove u'string' notation, which is a Python 2.x leftover, to match what learners will see with Python 3.x

Co-authored-by: Toby Hodges <tobyhodges@carpentries.org>
Co-authored-by: Jacob Deppen <deppen.8@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:enhancement Propose enhancement to the lesson

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants