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

gridplot का उपयोग

एस्टेट एजेंट यह देखना चाहते हैं कि प्रॉपर्टी के साइज और प्राइस के बीच का संबंध मेलबर्न के चार रीज़न में कैसे बदलता है:

"Northern", "Western", "Eastern", और "Southern".

यह gridplot इस्तेमाल करने का बेहतरीन मौका है, जिसमें हर रीज़न के लिए एक-एक subplot दिखाया जाएगा!

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

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

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

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

  • gridplot इम्पोर्ट करें.
  • इच्छित रीज़न के लिए melb को फ़िल्टर करके df बनाएँ.
  • कोड पूरा करें ताकि fig में circle glyphs ऐड हों, जहाँ x बिल्डिंग एरिया कॉलम हो और y प्राइस हो, source से, और legend_label के रूप में region हो.
  • सबप्लॉट्स को ग्रिड में दो कॉलम का उपयोग करके दिखाएँ.

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

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

# Import gridplot
from ____.____ import ____
plots = []

# Complete for loop to create plots
for region in ["Northern", "Western", "Southern", "Eastern"]:
  df = melb.loc[melb["region"] == ____]
  source = ColumnDataSource(data=df)
  fig = figure(x_axis_label="Building Area (Meters Squared)", y_axis_label="Price")
  fig.circle(x="____", y="____", source=____, legend_label=____)
  fig.yaxis[0].formatter = NumeralTickFormatter(format="$0a")
  plots.append(fig)

# Display plot
output_file(filename="gridplot.html")
show(____(____, ncols=____))
कोड संपादित करें और चलाएँ