This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
other:python:jyp_steps [2020/03/31 15:05] jypeter [Scipy Lecture Notes] |
other:python:jyp_steps [2021/03/17 09:48] jypeter [Graphics related resources] updated Bart paper's link |
||
---|---|---|---|
Line 55: | Line 55: | ||
- always remember that indices start at ''0'' and that the last element of an array is at index ''-1''!\\ First learn about //indexing// and //slicing// by manipulating strings, as shown in [[#part1|Part 1]] above (try '''This document by JY is awesome!'[::-1]'' and '''This document by JY is awesome!'[slice(None, None, -1)]'') 8-) | - always remember that indices start at ''0'' and that the last element of an array is at index ''-1''!\\ First learn about //indexing// and //slicing// by manipulating strings, as shown in [[#part1|Part 1]] above (try '''This document by JY is awesome!'[::-1]'' and '''This document by JY is awesome!'[slice(None, None, -1)]'') 8-) | ||
- | - if you are a Matlab user (but the references are interesting for others as well), you can read the following: | + | - if you are a **Matlab user** (but the references are interesting for others as well), you can read the following: |
+ | - [[https://www.enthought.com/wp-content/uploads/2019/08/Enthought-MATLAB-to-Python-White-Paper-1.pdf|Migrating from MATLAB to Python]] on the [[https://www.enthought.com/software-development/|Enthought Software Development page]] | ||
- [[https://docs.scipy.org/doc/numpy-dev/user/numpy-for-matlab-users.html|Numpy for Matlab users]] | - [[https://docs.scipy.org/doc/numpy-dev/user/numpy-for-matlab-users.html|Numpy for Matlab users]] | ||
- [[http://mathesaurus.sourceforge.net/matlab-numpy.html|NumPy for MATLAB users]] (nice, but does not seem to be maintained any more) | - [[http://mathesaurus.sourceforge.net/matlab-numpy.html|NumPy for MATLAB users]] (nice, but does not seem to be maintained any more) | ||
Line 197: | Line 198: | ||
* [[https://uxknowledgebase.com/tables-other-charts-data-visualization-part-2-cfc582e4712c|Tables & Other Charts — Data Visualization Part 2]] | * [[https://uxknowledgebase.com/tables-other-charts-data-visualization-part-2-cfc582e4712c|Tables & Other Charts — Data Visualization Part 2]] | ||
* [[https://uxknowledgebase.com/tables-other-charts-data-visualization-part-3-5bfab15ce525|Tables & Other Charts — Data Visualization Part 3]] | * [[https://uxknowledgebase.com/tables-other-charts-data-visualization-part-3-5bfab15ce525|Tables & Other Charts — Data Visualization Part 3]] | ||
- | * Working with colors | + | * **IPCC**-related //stuff//... |
+ | * [[https://www.ipcc.ch/site/assets/uploads/2019/04/IPCC-visual-style-guide.pdf|IPCC Visual Style Guide for Authors]] | ||
+ | * [[https://wg1.ipcc.ch/sites/default/files/documents/ipcc_visual-identity_guidelines.pdf|A new assessment cycle,A new visual identity]] | ||
+ | * [[https://link.springer.com/article/10.1007/s10584-019-02537-z|Communication of IPCC visuals: IPCC authors’ views and assessments of visual complexity]] | ||
+ | * [[https://www.carbonbrief.org/guest-post-the-perils-of-counter-intuitive-design-in-ipcc-graphics|The perils of counter-intuitive design in IPCC graphics]] | ||
+ | * Working with **colors** | ||
+ | * **Do not use the outdated //rainbow// colormap!** | ||
+ | * [[https://pjbartlein.github.io/datagraphics/index.html|The End of the Rainbow? Color Schemes for Improved Data Graphics]] (Light and Bartlein, EOS 2004, including replies and comments) | ||
+ | * [[http://colorspace.r-forge.r-project.org/articles/endrainbow.html|Somewhere over the Rainbow]] | ||
* [[https://matplotlib.org/users/colormaps.html|Choosing colormaps]] | * [[https://matplotlib.org/users/colormaps.html|Choosing colormaps]] | ||
* [[https://matplotlib.org/cmocean/|cmocean: Beautiful colormaps for oceanography]] | * [[https://matplotlib.org/cmocean/|cmocean: Beautiful colormaps for oceanography]] | ||
* [[https://jiffyclub.github.io/palettable/|Palettable: Color palettes for Python]] | * [[https://jiffyclub.github.io/palettable/|Palettable: Color palettes for Python]] | ||
* [[http://colorbrewer2.org|ColorBrewer 2.0]] is a tool that can help you understand, and experiment with //sequential//, //diverging// and //qualitative// colormaps | * [[http://colorbrewer2.org|ColorBrewer 2.0]] is a tool that can help you understand, and experiment with //sequential//, //diverging// and //qualitative// colormaps | ||
+ | * The [[http://hclwizard.org/|hclwizard]] provides tools for manipulating and assessing colors and palettes based on the underlying ''colorspace'' software | ||
+ | * NCL (NCAR Command Language) [[https://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml|Color table Gallery]] | ||
===== Basemap ===== | ===== Basemap ===== | ||
- | <note warning>Basemap is going to be slowly phased out, in favor of [[#cartopy]]\\ More information in this: | + | <note warning>Basemap is going to be slowly phased out, in favor of [[#cartopy_iris|cartopy]]\\ More information in this: |
* [[https://github.com/SciTools/cartopy/issues/920|cartopy github issue]] | * [[https://github.com/SciTools/cartopy/issues/920|cartopy github issue]] | ||
* [[https://github.com/matplotlib/basemap/issues/267|basemap github issue]] | * [[https://github.com/matplotlib/basemap/issues/267|basemap github issue]] | ||
Line 368: | Line 379: | ||
Depending on the distribution, the editor and the programming environment you use, you may have access to a graphical version of the debugger. UV-CDAT users can use ''pydebug my_script.py'' | Depending on the distribution, the editor and the programming environment you use, you may have access to a graphical version of the debugger. UV-CDAT users can use ''pydebug my_script.py'' | ||
+ | |||
+ | ===== jupyter and notebook stuff ===== | ||
+ | |||
+ | FIXME Misc notes, resources and links to organize later | ||
+ | |||
+ | * [[https://beta.jupyterbook.org/|jupyter {book}]]: Jupyter Book is an open source project for building beautiful, publication-quality books and documents from computational material. | ||
===== Using a Python IDE ===== | ===== Using a Python IDE ===== | ||
Line 410: | Line 427: | ||
===== Python 2.7 vs Python 3 ===== | ===== Python 2.7 vs Python 3 ===== | ||
- | The official [[https://docs.python.org/2.7/howto/pyporting.html|Porting Python 2 Code to Python 3]] page gives the required information to make the transition from python 2 to python 3. It is still safe to use Python 2.7, so there is no rush to change to Python 3. | + | It is still safe to use Python 2.7, but **you should consider upgrading to Python 3**, unless some key modules you need are not compatible (yet) with Python 3 |
+ | |||
+ | You should start writing code that will, when possible, work both in Python 2 and Python 3 | ||
+ | |||
+ | Some interesting reading: | ||
+ | |||
+ | * [[https://docs.python.org/3/whatsnew/3.0.html|What’s New In Python 3.0]].\\ Examples: | ||
+ | * ''print'' is now a function. Use ''print('Hello')'' | ||
+ | * You cannot test a difference with ''<>'' any longer! Use ''!='' | ||
+ | |||
+ | * The official [[https://docs.python.org/2.7/howto/pyporting.html|Porting Python 2 Code to Python 3]] page gives the required information to make the transition from python 2 to python 3. | ||
===== What now? ===== | ===== What now? ===== |