MulaiMulai sekarang secara gratis

Blog survey

You are a blogger that realized that up until 2014, four of the seven previous US presidents are/were left-handed. Out of curiosity, you conduct a survey asking your readers which hand they use for certain tasks. Your survey asks for respondents' gender, Gender, age Age, and handedness Left - right handed.

The dataset, pandas, and matplotlib.pyplot have been uploaded for you as hand_survey, pd, and plt, respectively.

Latihan ini adalah bagian dari kursus

Analyzing Survey Data in Python

Lihat Kursus

Petunjuk latihan

  • Create a crosstab which counts the number of left handed and right handed, male and female respondents.
  • Create a horizontal bar plot of your results.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Create a crosstab of male and female handedness
survey_crosstab = pd.____(____,____)

# Create a horizontal bar plot of your results
____
plt.show()
Edit dan Jalankan Kode