User Tools

Site Tools


other:python:jyp_steps

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
other:python:jyp_steps [2016/05/20 13:41]
jypeter Added a link to 'Working with Python' at the top
other:python:jyp_steps [2017/03/03 13:39]
jypeter Added Pandas
Line 13: Line 13:
 You can start using python by reading the {{:​other:​python:​python_intro_ipsl_oct2013_v2.pdf|Bien démarrer avec python}} tutorial that was used during a 2013 IPSL python class: You can start using python by reading the {{:​other:​python:​python_intro_ipsl_oct2013_v2.pdf|Bien démarrer avec python}} tutorial that was used during a 2013 IPSL python class:
   * this tutorial is in French (my apologies for the lack of translation,​ but it should be easy to understand)   * this tutorial is in French (my apologies for the lack of translation,​ but it should be easy to understand)
 +    * If you have too much trouble understanding this French Tutorial, you can read the first 6 chapters of the **Tutorial** in [[#​the_official_python_documentation|the official Python documentation]] and chapters 1.2.1 to 1.2.5 in the [[#​scipy_lecture_notes|Scipy Lecture Notes]]. Once you have read these, you can try to read the French tutorial again
   * it's an introduction to python (and programming) for the climate scientist: after reading this tutorial, you should be able to do most of the things you usually do in a shell script   * it's an introduction to python (and programming) for the climate scientist: after reading this tutorial, you should be able to do most of the things you usually do in a shell script
     * python types, tests, loops, reading a text file     * python types, tests, loops, reading a text file
Line 128: Line 129:
 ==== cdms2 ==== ==== cdms2 ====
  
-Summary: cdms2 can read/write netCDF files (and read //grads// dat+ctl files) and provides a higher level interface than netCDF4. Unfortunately,​ cdms2 is only available in the UV-CDAT distribution,​ and distributions where somebody has installed some version of //​cdat-lite//​. When you can use cdms2, you also have access to //cdtime//, that is very useful for handling time axis data.+Summary: cdms2 can read/write netCDF files (and read //grads// dat+ctl files) and provides a higher level interface than netCDF4. Unfortunately,​ cdms2 is only available in the [[other:​python:​starting#​uv-cdat|UV-CDAT distribution]], and distributions where somebody has installed some version of //​cdat-lite//​. When you can use cdms2, you also have access to //cdtime//, that is very useful for handling time axis data.
  
 How to get started: How to get started:
Line 163: Line 164:
  
 ===== Basemap ===== ===== Basemap =====
 +
 +<note warning>​It seems that basemap is going to be slowly phased out, in favor of [[#​cartopy]]\\ More information in this [[https://​github.com/​matplotlib/​basemap/​issues/​267|basemap github issue]]
 +</​note>​
  
 Summary: Basemap is an extension of Matplotlib that you can use for plotting maps, using different projections Summary: Basemap is an extension of Matplotlib that you can use for plotting maps, using different projections
Line 171: Line 175:
   - look at the [[http://​matplotlib.org/​basemap/​users/​examples.html|examples]]   - look at the [[http://​matplotlib.org/​basemap/​users/​examples.html|examples]]
   - check the [[http://​matplotlib.org/​basemap/​users/​mapsetup.html|different projections]]   - check the [[http://​matplotlib.org/​basemap/​users/​mapsetup.html|different projections]]
-  - look at the [[http://​matplotlib.org/​basemap/​api/​basemap_api.html#​module-mpl_toolkits.basemap|detailed documentation]]+  ​- read some documentation! 
 +    - the **really nice** [[http://​basemaptutorial.readthedocs.io/​en/​latest/​index.html|basemap tutorial]] seems much better than the official documentation below 
 +    ​- look at the [[http://​matplotlib.org/​basemap/​api/​basemap_api.html#​module-mpl_toolkits.basemap|detailed ​official ​documentation]] 
 + 
 +===== Cartopy ===== 
 + 
 +Summary: //Cartopy makes use of the powerful PROJ.4, numpy and shapely libraries and has a simple and intuitive drawing interface to matplotlib for creating publication quality maps// 
 + 
 +Where: [[http://​scitools.org.uk/​cartopy/​docs/​latest/​|Cartopy web site]] 
 + 
 +===== Pandas ===== 
 + 
 +Summary: //pandas is a library providing high-performance,​ easy-to-use data structures and data analysis tools// 
 + 
 +Where: [[http://​pandas.pydata.org|Pandas web site]]
  
 +JYP's comment: pandas is supposed to be quite good for loading, processing and plotting time series, without writing custom code. You should at least have a quick look at:
 +  * The [[http://​www.scipy-lectures.org/​packages/​statistics/​index.html|Statistics in Python]] tutorial that combines Pandas, [[http://​statsmodels.sourceforge.net/​|Statsmodels]] and [[http://​seaborn.pydata.org/​|Seaborn]]
 +  * the cheat sheet on the [[https://​www.enthought.com/​services/​training/​pandas-mastery-workshop/​|Enthought workshops advertising page]]
 +  * the cheat sheet on the [[https://​github.com/​pandas-dev/​pandas/​tree/​master/​doc/​cheatsheet|github Pandas doc page]]
  
 ===== Scipy Lecture Notes ===== ===== Scipy Lecture Notes =====
Line 180: Line 202:
 Where: [[http://​www.scipy-lectures.org/​_downloads/​ScipyLectures-simple.pdf|pdf]] - [[http://​www.scipy-lectures.org/​|html]] Where: [[http://​www.scipy-lectures.org/​_downloads/​ScipyLectures-simple.pdf|pdf]] - [[http://​www.scipy-lectures.org/​|html]]
  
-This is a really nice document that is regularly updated and used for the [[https://​www.euroscipy.org/​|EuroScipy]] tutorials. You will learn more things about python, numpy and matplotlib, debugging and optimizing scripts, and also learn about using python for statistics, image processing, machine learning, washing dishes (this is just to check if you have read this page), etc...+This is **a really nice and useful ​document** that is regularly updated and used for the [[https://​www.euroscipy.org/​|EuroScipy]] tutorials. You will learn more things about python, numpy and matplotlib, debugging and optimizing scripts, and also learn about using python for statistics, image processing, machine learning, washing dishes (this is just to check if you have read this page), etc...
  
 ===== Quick Reference ===== ===== Quick Reference =====
other/python/jyp_steps.txt · Last modified: 2024/03/07 10:15 by jypeter