python-ecology-lesson icon indicating copy to clipboard operation
python-ecology-lesson copied to clipboard

Improve pandas code and formatting

Open deppen8 opened this issue 5 years ago • 1 comments

  • 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 [email protected] 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 [email protected].


deppen8 avatar Jun 23 '20 06:06 deppen8

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 avatar Jul 23 '20 14:07 maxim-belkin

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 avatar Apr 04 '23 12:04 tobyhodges

Superseded by #541

tobyhodges avatar Apr 25 '23 12:04 tobyhodges