block by curran 74d2a088caa5a32fcbd52fa092f46d94

Data Table Summary Abalone

Full Screen

This example summarizes a data table using Datalib. You can fork this Block and change the data to get a quick overview of the shape of your data.

This data is from UCI Machine Learning Repository: Abalone Data Set .

This data set mainly describes the Sex/Length/Diameter/Height/WHole weight/Shucked weight/Viscera weight/Shell weight/RIngs of abolonies.

forked from curran‘s block: Data Table Summary

forked from thomaxyu001‘s block: Data Table Summary Abalone

index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Data Summary</title>
    <script src="https://d3js.org/d3.v4.min.js"></script>
    <script src="https://unpkg.com/datalib@1.8.0/datalib.min.js"></script>
    <style>

    </style>
  </head>
  <body>
    <script>
      
      // Use these for other formats:
      // d3.tsv('data.tsv', data => {
      // d3.json('data.json', data => {
      
      // Load and summarize the data.
      d3.csv('abalone.data.csv', data => {
        
        // Assemble a summary string.
        const summary = [
          'Data table summary: ',
          data.length + ' rows',
          data.columns.length + ' columns',
          Math.round(d3.csvFormat(data).length / 1024) + ' kB',
          '\nSummary of each column:',
          dl.format.summary(data)
        ].join('\n');
        
        // Show the summary string on the page.
        d3.select('body').append('pre').text(summary);
        
        // Log the summary to the console.
        console.log(summary);
        console.log("test")
      });

    </script>
  </body>
</html>