<jupyter_start><jupyter_text>Summary Dive provides an interactive interface for exploring the relationship between data points across all of the different features of a dataset. Each individual item in the visualization represents a data point. Position items by "faceting" or bucketing them in multiple dimensions by their feature values. Success stories of Dive include the detection of classifier failure, identification of systematic errors, evaluating ground truth and potential new signals for ranking. The Dive visualization shows each individual item in the training dataset. Clicking on an individual item reveals key/value pairs that represent the features of that record; values may be strings or numbers.In this section, you'll learn how to use Dive embedded in your on page or app. The two things you need are your own data, and the Dive Polymer element.The facets-dive element has many attributes you can set to customize its behavior, but the only one you absolutely must set is data. This should be an array of JavaScript objects, where each object represents a single record.This demo was based on the demo below  https://github.com/PAIR-code/facets/tree/master/facets_dive<jupyter_code># Load data from https://covid.ourworldindata.org/data/ecdc/locations.csv and convert to json for sending to the visualization
# Load dataframe from external CSV and add header information
import pandas as pd
features = ["countriesAndTerritories", "location", "continent", "population_year","population"]
df = pd.read_csv(
    "https://covid.ourworldindata.org/data/ecdc/locations.csv",
    names=features
    )
jsonstr = df.to_json(orient='records')
# Display the Dive visualization for this data
from IPython.core.display import display, HTML

# Create Facets template  

HTML_TEMPLATE = \
    """
        <link rel="import" href="/nbextensions/facets-dist/facets-jupyter.html">
        <facets-dive id="elem_id" height="600"></facets-dive>
        <script>
          var data = {jsonstr};
          document.querySelector("#elem_id").data = data;
        </script>
    """

# Load the json dataset into the template
html = HTML_TEMPLATE.format(jsonstr=jsonstr)
# Display the template
display(HTML(html))<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup