Open nathanrboyer opened 2 years ago
Care to submit a pull request? You can just click "Fork" and hit "." to open a browser instance of VSCode.
Hopefully someday. I have DataFrames documentation that I need to finish first, and I still don't totally understand how pairs
and CartesianIndices
are supposed to be used.
https://docs.julialang.org/en/v1/manual/arrays/#Iteration The documentation here needs a section on iterating over slices of an array.
My first instinct coming from Matlab is to write loops like this:
If I come across
size
elsewhere in the documentation, then I might switch to the better:However, neither of the above should really be used.
pairs
andaxes
are usually suggested on Discourse instead, but these function names are not intuitive to search for or use in this context. It would be nice to explain when to use the many different indexing functions available in Julia and their interaction withCartesianIndices
.Another topic that should be addressed in this section is the correct syntax order for accessing arrays in column order. In the examples below, the loop order of
nested!
andcomprehension
are natural to me, but the loop order ofnested_compact!
seems backwards. Since it is not obvious how the loops unwrap, it should be documented.