1. Learn
  2. /
  3. Courses
  4. /
  5. Importing Data in Python

Connected

Exercise

Importing Stata files

Herein, you'll gain expertise in importing Stata files as DataFrames using the pd.read_stata() function from pandas. The file 'disarea.dta' is already in your working directory. The data consist of disease extent for several diseases in various countries (more information can be found here).

Instructions

100 XP
  • Use pd.read_stata() to load the file 'disarea.dta' into the DataFrame df.
  • Print the head of the DataFrame df.
  • Visualize your results by plotting a histogram of the column disa10. We’ve already provided this code for you, so just run it!