Python throw-back: making mazes again

I had an escapist hobby that is captured in the history of this blog, making maze [link], and I need escape again. And now I have a 5-year-old User for the output! Cool things: the maze-making code from 7 years ago was pretty easy to get working again [links, links]; the scientific python ecosystem now has notebooks! [link]

[Photo of done mazes on paper.]

Comments Off on Python throw-back: making mazes again

Filed under combinatorial optimization

Life Expectancy and Cause-Specific Mortality by Census Tract in King County, Washington

Some new research that I’m excited about came out last week: Variation in life expectancy and mortality by cause among neighborhoods in King County, WA, USA, 1990–2014: a census tract-level analysis for the Global Burden of Disease Study 2015.

In some ways, it is very specific to Seattle and the surrounding county:

But it is also a demonstration of the “fractal” nature of population health—the variation between life expectancy from country to country around the world is big! But it is around as big as the variation between life expectancy from county to county around the United States. And what this work shows is that even in the county where I live, the life expectancy varies between census tracts almost as much as from county to county or country to country. Inequality is happening at all scales.

Here is the data:

Comments Off on Life Expectancy and Cause-Specific Mortality by Census Tract in King County, Washington

Filed under disease modeling

Links about brainstorming

not necess related:

Comments Off on Links about brainstorming

Filed under working

Half-birthday for Diversity Club

For the last six months I’ve made brief mentions of the happenings of IHME “Diversity Club” on Healthy Algorithms. What is it?

I’m not sure if I mentioned, but I’m a co-chair of the Department of Global Health Diversity Committee, and we had a strategic retreat in December, where we identified “Training (Stand-alone and in curriculum)” as one of our top three priorities. We had a good brainstorm on ways to advance this priority, and an idea that stuck with me from it was “Different types of workshops, trainings, dialogues (format and topic – individual, structural, policy)”

Diversity Club is a different type of workshop. It has low-overhead. It is regularly recurring. And it has drawn a range of interest, depending on the time of year, the topic, and the competing priorities around IHME.

You can see some of the things we’ve discussed tagged diversity club on HA

Looking back on them, discussing The Invisible Knapsack was the one I was most nervous about it went fine.

Counter-measures for implicit bias left me the most optimistic about the possibility of positive change

I’ll report back again at a year.

Comments Off on Half-birthday for Diversity Club

Filed under Uncategorized

Visual Communication in Python: Pie Charts with Matplotlib

A personal story about how I started using Python for my research: when I was a post-doc at Microsoft, I was embarrassed to ask them to buy me Matlab. But I knew how to plot things in Matlab and I didn’t have time to learn how to make a graphic look nice with Excel or whatever the preferred Microsoft tool was at the time. Matplotlib to the rescue. It was free, it looked *better* than Matlab, and then it was done.

As readers of this blog may know, I have come to use Python extensive in my research by now. But one thing that I have not changed in the 10 years since that post-doc experience is using matplotlib like it was Matlab. It might be time to change.

I recently read a short blog on the modern approach to using Matplotlib,, and it seems worth a try. Do you remember a talk on data visualization I gave last fall?

I’m going to try remaking the plots I spoke on with my old school mpl and the modern approach. Here is the first, a pie chart.

My old-fashioned way is in a notebook from my talk, and looks like this:

plt.subplots_adjust(hspace=.3, right=.8, left=.1)
plt.pie([2,98], labels=['Survived\n2%', 'Died\n98%'], colors=colors, startangle=0)

The new way is built up in this notebook here, and ends up being comparable:

fig, ax = plt.subplots(figsize=(9,8))
s.plot(kind='pie', colors=colors, startangle=0)
fig.subplots_adjust(hspace=.3, right=.8, left=.1)

Is that cooler? I’m not convinced, but I’ll keep trying.

Comments Off on Visual Communication in Python: Pie Charts with Matplotlib

Filed under dataviz

To read: Building Sustainable Financing Structures for Population Health: Insights from Non-Health Sectors

Comments Off on To read: Building Sustainable Financing Structures for Population Health: Insights from Non-Health Sectors

Filed under Uncategorized

Righter signatures in Jupyter

Did you know you can change the signature of functions dynamically in Python 3? It is a bit nasty, and maybe will make things look nicer for vivarium users.

SO question that got me started:

Comments Off on Righter signatures in Jupyter

Filed under Uncategorized

Introducing Vivarium

I’ve had a new line of research developing for the last 18 months or so—*microsimulation*. It started when I stepped in to help with the “Cost Effectiveness Analysis with Microsimulation” (or CEAM) project at IHME. Now it is growing and growing to take over all of my research and recreation time. Is that bad or good?

Some of this work has now seen daylight from our presentations at SummerSim and iHEA in July, and today I am please to introduce a python package that you can use, too.

The programmers I’ve been working with on this convinced me that it is not just for cost effectiveness analysis and we need a more expansive name for it. So I present to you: vivarium.


Filed under Uncategorized

MAL-ED study

I needed to get up to speed on this large data collection effort, so I thought I’d collect what I found here, for my own reference and in case it was of interest to others.

> The purpose of this study was to collect longitudinal data on the relationships between malnutrition and enteric infections in children ages 17 days through approximately 2 years.
> The data were collected through in-person interviews in the home, anthropometry, cognitive exams, and biological samples. The samples collected included blood, urine, and stool. The households were visited twice weekly for interviews and stool samples. Anthropometric measurements were gathered at monthly intervals. Blood samples were taken at 7 and 15 months of age to assess micronutrient levels and vaccination status. Children underwent the lactulose-mannitol urine test for gut function at 3, 6, 9, 15, and 24 months.
> The study was conducted in subnational areas of Bangladesh, Brazil, India, Peru, Pakistan, Nepal, South Africa, and Tanzania. Each site had a sample size of approximately 200 children.

(n = 2,053)

Click to access f8554f0636113e42f6d34f82347e015381d2.pdf

Comments Off on MAL-ED study

Filed under Uncategorized

I have used IPython Notebooks for my lab book for 5 years

And it is still working well. Here is what I did in my first one:

You think that is mixed yet?

Comments Off on I have used IPython Notebooks for my lab book for 5 years

Filed under Uncategorized