UBC-DSCI / introduction-to-datascience-python

Open Source Textbook for DSCI100: Introduction to Data Science in Python
https://python.datasciencebook.ca
Other
10 stars 8 forks source link

Axes: `axis="columns"` versus `axis=1` #312

Open trevorcampbell opened 10 months ago

trevorcampbell commented 10 months ago

An alternative here is to say axis='columns' and then emphasize above that when we are applying a function row-wise it will go across all the columns which links to the name of this option (so that students don't think it should be called "rows" since it is "row-wise"). I'll let you pick what you think is clearer, just a possible alternative, I generally like naming the axes with a string instead of a number personally since I forget which is axis 0 and 1 constantly... (and I think there is some pandas function where they are confusingly inverted). There is a couple of occurences of this further down in case you decide to change it

_Originally posted by @joelostblom in https://github.com/UBC-DSCI/introduction-to-datascience-python/pull/301#discussion_r1391505295_

trevorcampbell commented 10 months ago

Need to check how this would propagate throughout the book before doing. Not necessary for 1st edition.