Python is an increasingly popular tool for data analysis in the social scientists. Empowered by a number of libraries that have reached maturity, R and Stata users are increasingly moving to Python in order to take advantage of the beauty, flexibility, and performance of Python without sacrificing the functionality these older programs have accumulated over the years.
But while Python has much to offer, existing Python resources are not always well-suited to the needs of social scientists. With that in mind, I’ve recently created a new resource—www.data-analysis-in-python.org (DAP)—tailored specifically to the goals and desires of the social scientist Python user.
The site is not a new set of tutorials, however—there are more than enough Python tutorials in the world. Rather, the aim of the site is to curate and annotate existing resources, and to provide users guidance on what topics to focus on and which to skip.
Today, most empirical social science remains organized around tabular data, meaning data that is presented with a different variable in each column and a different observation in each row. As a result, many social scientists using Python are a little confused when they don’t find a tabular data structure covered in their intro to Python tutorial. To address this confusion, DAP does its best to introduce users to the pandas library as fast as possible, providing links to tutorials and a few tips on gotchas to watch out for.
The pandas library replicates much of the functionality that social scientists are used to finding in Stata or R—data can be represented in a tabular format, column variables can be easily labeled, and columns of different types (like floats and strings) can be combined in the same dataset.
Other Libraries by Research Area
While all social scientists who wish to work with Python will need to understand the core language and most will want to be familiar with
pandas, the Python eco-system is full of application-specific libraries that will only be of use to a subset of users. With that in mind, DAP provides an overview of libraries to help researchers working in different topic areas, along with links to materials on optimal use, and guidance on relevant considerations:
Want to Get Involved?
This is a guest blog post by Nick Eubank, a Post-Doctoral Fellow at the Center for the Study of Democratic Institutions at Vanderbilt University