other:python:misc_by_jyp
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
other:python:misc_by_jyp [2023/11/29 11:32] – [Working with paths and filenames] Improved and added pathlib example jypeter | other:python:misc_by_jyp [2024/04/19 14:02] – [Data representation] Corrected link to an old JYP tutorial jypeter | ||
---|---|---|---|
Line 5: | Line 5: | ||
</ | </ | ||
+ | ===== Extra tutorials ===== | ||
+ | Only **when you have already read all the content of this page several times**, and you are looking for new ideas | ||
+ | |||
+ | * [[https:// | ||
===== Reading/ | ===== Reading/ | ||
Line 313: | Line 317: | ||
[' | [' | ||
+ | |||
+ | ===== Efficient looping with numpy, map, itertools and list comprehension ===== | ||
+ | |||
+ | <wrap hi>Big, nested, explicit '' | ||
+ | |||
+ | * **'' | ||
+ | * **Masked arrays** can be used to deal with //special cases// and remove tests from loops | ||
+ | |||
+ | * The built-in [[https:// | ||
+ | * < | ||
+ | |||
+ | >>> | ||
+ | [' | ||
+ | |||
+ | >>> | ||
+ | [' | ||
+ | |||
+ | * The [[https:// | ||
+ | * Example: replacing nested loops with [[https:// | ||
+ | * < | ||
+ | < | ||
+ | |||
+ | >>> | ||
+ | [(' | ||
+ | |||
+ | >>> | ||
+ | ... | ||
+ | ... | ||
+ | A0 | ||
+ | A1 | ||
+ | B0 | ||
+ | B1 | ||
+ | |||
+ | >>> | ||
+ | ... | ||
+ | ... | ||
+ | A0 | ||
+ | A1 | ||
+ | B0 | ||
+ | B1 | ||
+ | |||
+ | >>> | ||
+ | ... | ||
+ | ... | ||
+ | A0$, A0!, A1$, A1!, B0$, B0!, B1$, B1!,</ | ||
+ | |||
+ | * The [[https:// | ||
+ | * Example: converting a list of integers to a list of strings\\ Note: in that case, you should rather use the '' | ||
+ | * < | ||
+ | |||
+ | >>> | ||
+ | [' | ||
===== numpy related stuff ===== | ===== numpy related stuff ===== | ||
Line 492: | Line 548: | ||
A few notes for a future section or page about about //data representation// | A few notes for a future section or page about about //data representation// | ||
- | FIXME Add parts (pages 28 to 37) of this [[https://wiki.lsce.ipsl.fr/ | + | FIXME Add parts (pages 28 to 37) of this [[http://www.lsce.ipsl.fr/ |
==== Base notions ==== | ==== Base notions ==== |
other/python/misc_by_jyp.txt · Last modified: 2024/11/04 15:01 by jypeter