Select a single sheet
An Excel workbook may contain multiple sheets of related data. The New Developer Survey response workbook has sheets for different years. Because read_excel()
loads only the first sheet by default, you've already gotten survey responses for 2016. Now, you'll create a dataframe of 2017 responses using read_excel()
's sheet_name
argument in a couple different ways.
pandas
has been imported as pd
.
This exercise is part of the course
Streamlined Data Ingestion with pandas
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create df from second worksheet by referencing its position
responses_2017 = pd.read_excel("fcc_survey.xlsx",
____)
# Graph where people would like to get a developer job
job_prefs = responses_2017.groupby("JobPref").JobPref.count()
job_prefs.plot.barh()
plt.show()