Other articles


  1. Select time ranges in multidimensional arrays with pandas

    Task

    Select specific time ranges from multidimensional arrays
    
    

    Solution

    Pandas periods

    I like pandas for very easy time handling, and would like to use similar approach when work with multidimensional arrays, for example from netCDF files. There are already some efforts to do this. However I don't need anything complicated, just select some months, years of time periods. For this I can use pandas itself and benefit from its great time indexing. Below I will show a small example of how to do this.

    Necessary imports (everything can be installed from Anaconda)

    read more

    There are comments.

  2. Time series analysis with pandas. Part 2

    Task:

    continue interactive analysis of time series (AO, NAO indexes)
    
    

    Module:

    pandas

    In the previous part we looked at very basic ways of work with pandas. Here I am going to introduce couple of more advance tricks. We will use very powerful pandas IO capabilities to create time series directly from the text file, try to create seasonal means with resample and multi-year monthly means with groupby. At the end I will show how new functionality from the upcoming IPython 2.0 can be used to explore your data more efficiently with sort of a simple GUI (interact function). There might be easier or better ways to do some of the things discussed here, and I will be happy to hear about them in comments :)

    read more

    There are comments.

  3. Climatology data access with ulmo

    Task:

    easy access to climatology data 
    
    

    Solution:

    ulmo
    
    

    Notebook file

    One of the main things that bothers me most at work is data conversion. World would be a much better place for somebody like me if everybody use netCDF file format for data distribution. While situation slightly changing, and more and more organisations switch to netCDF, there are still plenty of those who distribute their data in some crazy forms.

    Would it be nice if somebody once and for all create converters for all this formats and provide a way to directly search and access data from python? Imagine - instead of spending time writing regular expressions for another converter you could watch cat videos on youtube read more

    There are comments.

  4. Time series analysis with pandas

    Task:

    analysis of several time series data (AO, NAO)
    
    

    Modules:

    pandas
    
    

    Notebook file

    Here I am going to show just some basic pandas stuff for time series analysis, as I think for the Earth Scientists it's the most interesting topic. If you find this small tutorial useful, I encourage you to watch this video, where Wes McKinney give extensive introduction to the time series data analysis with pandas.

    On the official website you can find explanation of what problems pandas solve in general, but I can tell you what problem pandas solve for me. It makes analysis and visualisation of 1D data, especially time series, MUCH faster. Before pandas working with time series in python was a pain for me, now it's fun. Ease of use stimulate in-depth exploration of the data: why wouldn't you make some additional analysis if it's just one line of code? Hope you will also find this great tool helpful and useful. So, let's begin.

    read more

    There are comments.

links

social