Literacy/Fertility डेटा की EDA
अगले कुछ अभ्यासों में, हम दुनिया भर में महिला साक्षरता और fertility (प्रति महिला जन्मे बच्चों की औसत संख्या) के बीच सहसंबंध देखेंगे। विश्लेषण और व्याख्या को आसान बनाने के लिए, हम असाक्षरता दर के साथ काम करेंगे.
विश्लेषण शुरू करने से पहले कुछ EDA करना हमेशा अच्छा रहता है। इसी उद्देश्य से, illiteracy के मुकाबले fertility को plot करें और Pearson correlation coefficient की गणना करें। NumPy array illiteracy में दुनिया के अधिकांश देशों की महिलाओं की असाक्षरता दर है। array fertility में संबंधित fertility डेटा है.
यहाँ, Pearson correlation coefficient निकालने के लिए पिछले कोर्स में आपने लिखा फंक्शन देखना उपयोगी हो सकता है.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Statistical Thinking in Python (Part 2)
अभ्यास निर्देश
illiteracy(x-axis) के मुकाबलेfertility(y-axis) को scatter plot के रूप में plot करें.- 2% margin सेट करें.
illiteracyऔरfertilityके बीच Pearson correlation coefficient compute करके प्रिंट करें.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Plot the illiteracy rate versus fertility
_ = plt.plot(____, ____, ____='.', ____='none')
# Set the margins and label axes
plt.margins(____)
_ = plt.xlabel('percent illiterate')
_ = plt.ylabel('fertility')
# Show the plot
plt.show()
# Show the Pearson correlation coefficient
print(pearson_r(____, ____))