शुरू करेंमुफ़्त में शुरू करें

Categorical कॉलम subplots

रियल एस्टेट एजेंट चाहते हैं कि आप जाँचें कि मेलबर्न के अलग-अलग regions में property size और land की मात्रा कैसे बदलती है. column layout की मदद से, आप region को x-axis के रूप में इस्तेमाल करते हुए इन संबंधों को दिखाने वाले दो subplots बना सकते हैं.

melb DataFrame को region के आधार पर group किया गया है, और land_area तथा building_area के औसत मान निकाले गए हैं. इसे आपके लिए पहले से तैयार Bokeh data object source के रूप में सेट किया गया है.

यह अभ्यास पाठ्यक्रम का हिस्सा है

Bokeh के साथ इंटरएक्टिव डेटा विज़ुअलाइज़ेशन

पाठ्यक्रम देखें

अभ्यास निर्देश

  • संबंधित Bokeh मॉड्यूल से column import करें.
  • building_size में bar glyphs जोड़ें, ताकि हर "region" के लिए "building_area" plot हो.
  • land_size में bar glyphs जोड़ें, जो हर "region" के लिए "land_area" दर्शाएँ.
  • "my_first_column.html" नाम की एक HTML फ़ाइल जनरेट करें, और दोनों subplots दिखाने के लिए show() की कॉल पूरी करें.

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Import column
from ____.____ import ____
regions = ["Eastern", "Southern", "Western", "Northern"]
building_size = figure(x_axis_label="Region", y_axis_label="Building Size (Meters Squared)", 
                       x_range=regions)
land_size = figure(x_axis_label="Region", y_axis_label="Land Size (Meters Squared)", 
                   x_range=regions)

# Add bar glyphs
building_size.____(x="____", top="____", source=____)
land_size.____(x="____", top="____", source=____)

# Generate HTML file and display the subplots
output_file(filename="____")
show(____(____, ____))
कोड संपादित करें और चलाएँ