Bee swarm plot
iris के petal lengths का एक bee swarm plot बनाएँ. आपकी x-axis पर तीनों species हों, और y-axis पर petal lengths. डेटा वाला DataFrame आपके namespace में df नाम से मौजूद है.
संदर्भ के लिए, वीडियो में Justin द्वारा bee swarm plot बनाने का कोड नीचे दिया गया है:
_ = sns.swarmplot(x='state', y='dem_share', data=df_swing)
_ = plt.xlabel('state')
_ = plt.ylabel('percent of vote for Obama')
plt.show()
seaborn का उपयोग करके bee swarm plots कैसे बनाएँ, इस पर और जानकारी के लिए आप help(sns.swarmplot) का उपयोग कर सकते हैं.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Statistical Thinking in Python (Part 1)
अभ्यास निर्देश
df.head()का उपयोग करके DataFramedfदेखें. इससे आप पहचान पाएँगे किsns.swarmplot()कॉल मेंxऔरyकीवर्ड आर्ग्युमेंट्स के लिए किन कॉलम नामों को पास करना है.- Fisher iris डेटा सेट वाले DataFrame
dfसेsns.swarmplot()का उपयोग कर bee swarm plot बनाएँ. x-axis पर तीनों species हों, और y-axis पर petal lengths हों. - axes को लेबल करें.
- अपना प्लॉट दिखाएँ.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Create bee swarm plot with Seaborn's default settings
# Label the axes
# Show the plot