Percentiles निकालना
इस अभ्यास में, आप Iris versicolor की petal length के percentiles की गणना करेंगे.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Statistical Thinking in Python (Part 1)
अभ्यास निर्देश
percentilesबनाएँ — यह उन percentiles का NumPy array होगा जिनकी आपको गणना करनी है: 2.5th, 25th, 50th, 75th, और 97.5th. इसके लिए इन ints/floats की एक list बनाएँ औरnp.array()का उपयोग करके list को NumPy array में बदलें. उदाहरण के लिए,np.array([30, 50])30th और 50th percentiles वाला array बनाता है.- Iris versicolor सैंपल्स की petal lengths के percentiles निकालने के लिए
np.percentile()का उपयोग करें. वैरिएबलversicolor_petal_lengthआपके namespace में मौजूद है. - निकले हुए percentiles प्रिंट करें.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Specify array of percentiles: percentiles
# Compute percentiles: ptiles_vers
# Print the result