python-novice-inflammation icon indicating copy to clipboard operation
python-novice-inflammation copied to clipboard

Describe/Document 'sorted' function

Open charlie-becker opened this issue 4 years ago • 1 comments

In the 'Tidying Up' section of the Creating Functions episode, the sorted built in function is introduced without providing any current (or prior) documentation about what it does. The line in question is:

filenames = sorted(glob.glob('inflammation*.csv'))

Possible solutions:

  • include a comment in the code itself

  • Add a description in the paragraph above

  • Remove the sorted command all together

charlie-becker avatar Dec 16 '19 22:12 charlie-becker

Hi @charlie-becker, thanks for bringing up your concern. The sorted function first appears in the 05-files.md episode where it is briefly introduced to alphabetically sort the list of files produced by glob.glob(). When it comes up in the "Tidying Up" section it is in the context of "[reproducing] the previous analysis".

ldko avatar Dec 16 '19 22:12 ldko