IDV in Python: Retrieve Data From Dynamic mpld3 plot in python

Mpld3 questions show up on Stack Overflow from time to time, too, and they can get really informative answers if they pull in the javascript experts. This one got a comprehensive answer that was perhaps too expert, and so this follow up was an opportunity to show off my interactive plot call-out plugin yet again.

Leave a comment

Filed under software engineering

MCMC in Python: observed data for a sum of random variables in PyMC

I like answering PyMC questions on Stack Overflow, but sometimes I give an answer and end up the one with the question. Like what would you model as the sum of a Poisson and a Negative Binomial?

Leave a comment

Filed under statistics

SciPy2014 Plotting Contest

I helped judge a plotting contest for the Scientific Python conference last summer. Who won? I don’t know, and a short web searching binge didn’t find out. A lovely plot took 3rd place, and every entry is here (with sourcecode). Good stuff for seeing how different groups do different tricks, and for checking what still doesn’t work in mpld3.

Leave a comment

Filed under dataviz

Styling Excel with Pandas

I had a bunch of stylish tables to make once long ago, and I thought, “why don’t I do that automatically?” It would take longer the first time, but it would be faster in future iterations. Unfortunately, there never were any future iterations, but fortunately, it was more fun to research automatic generation of stylish tables than do what I needed to get done.

The seeds I planted have started to sprout a little bit, though, and the latest pandas now supports openpyxl2 which supports a lot of style. So here is a start on the stylish table writing feature.

Leave a comment

Filed under software engineering

IHME Seminar: Environmental Indicators

On Oct 15, we had a seminar from Yale Professor Angel Hsu on her work developing indicators for country performance on environmental sustainability. I found it surprisingly positive, for example this score card for the United States that says almost everything is getting better or at least staying the same:

Capture

This seems to conflict with the EPA report that came out recently and reminded me to write this.

Capture

Leave a comment

Filed under global health

Talks in Python: Interactive Instruction with RISE

I had a chance to give a lecture on using Python/Pandas in scientific research this week, and it was __________ (fill this in after it happens…). Since I was talking about Python, I decided to make my talk in Python, too. I did this for a few classes in Winter and Summer quarters of 2013, but the technology has come a long way since then. For this time around, I used RISE aka the live_reveal extension, and I found it very promising, although _very_ “bleeding edge” (which is what happens when the cutting edge is too cutting).

To make it really work as a powerpoint killer, I think it needs a little more friendlyness on the slide layout side of things. I don’t need much, but I would like:
* a talk title slide that has title, name, and date;
* a full-screen image slide;
* a way to put slide titles in a consistent place;

Am I totally power-pointed in my desires? I should file some issues on github.

Other wishes, while it’s on my mind: would be helpful to start slideshow from highlighted cell, would be convenient if cell toolbar toggled automatically between slideshow to none when starting and stopping presentation display, make it all easy easy easy to use.

Leave a comment

Filed under education

IPython Notebook Clipboard Extension

I was so excited when I got the image pasting to work in my IPython Notebook, (although now I can’t find any mention of it on Healthy Algorithms…) but then things changed and I didn’t keep up, and it stopped working for me for a while. But then I _needed_ it, and so I figured out how to make it work again:

* upgrade IPython to the latest development version from github – https://github.com/ipython/ipython
* install the chrome_clipboard ipython notebook extension – https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/chrome_clipboard
* make it work each time, by adding a line to `~/.ipython/profile_[name]/static/custom/custom.js`:

$([IPython.events]).on('app_initialized.NotebookApp', function(){
require(['nbextensions/chrome_clipboard'],function(module){
module.load_ipython_extension();
});
});

So nice to have it back.

Leave a comment

Filed under software engineering