Skip to content

Instantly share code, notes, and snippets.

@seschultz
Last active October 12, 2017 03:34
Show Gist options
  • Save seschultz/1f8b0660b6d824c00ae190b5a9438497 to your computer and use it in GitHub Desktop.
Save seschultz/1f8b0660b6d824c00ae190b5a9438497 to your computer and use it in GitHub Desktop.
Data Table Summary- Allegheny County Median Income
license: mit

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 Data USA.

This dataset contains the median income of each census tract in Allegheny County in 2015.

forked from curran's block: Data Table Summary

Year Census Tract Median Income
2015 10300 41071
2015 20100 67750
2015 20300 94643
2015 30500 17997
2015 40200 19214
2015 40400 26196
2015 40500 17441
2015 40600 21277
2015 40900 26964
2015 50100 17692
2015 50600 26250
2015 50900 11975
2015 51000 14544
2015 51100 9773
2015 60300 37431
2015 60500 37273
2015 70300 54821
2015 70500 51250
2015 70600 47336
2015 70800 51703
2015 70900 33929
2015 80200 40144
2015 80400 32837
2015 80600 51509
2015 80700 36944
2015 80900 49750
2015 90100 50781
2015 90200 53724
2015 90300 33816
2015 100500 41051
2015 101100 41615
2015 101400 45761
2015 101600 26905
2015 101700 32163
2015 101800 56556
2015 110200 48011
2015 110600 67411
2015 111300 33400
2015 111400 21154
2015 111500 24308
2015 120300 25368
2015 120400 15960
2015 120700 19762
2015 120800 25689
2015 130100 16630
2015 130200 27500
2015 130300 13986
2015 130400 24250
2015 130600 18012
2015 140100 119688
2015 140200 72115
2015 140300 113553
2015 140400 127813
2015 140500 51389
2015 140600 65417
2015 140800 67944
2015 141000 77857
2015 141100 68105
2015 141300 48000
2015 141400 61856
2015 151600 57204
2015 151700 56114
2015 160800 43068
2015 160900 53241
2015 170200 43750
2015 170600 43508
2015 180300 29646
2015 180700 39023
2015 190300 65469
2015 191100 62206
2015 191400 42216
2015 191500 34496
2015 191600 43977
2015 191700 49321
2015 191800 55271
2015 191900 39315
2015 192000 41891
2015 202200 42226
2015 202300 56600
2015 210700 40403
2015 220600 40000
2015 240600 40566
2015 241200 31466
2015 250300 43750
2015 250700 23977
2015 250900 21607
2015 260200 40869
2015 260700 50608
2015 260900 9974
2015 261200 59120
2015 261400 23590
2015 261500 23906
2015 262000 26361
2015 270100 54053
2015 270300 32788
2015 270400 40673
2015 270800 66161
2015 271500 37438
2015 281400 36490
2015 281500 43333
2015 290100 34008
2015 290200 37183
2015 290400 44254
2015 300100 27733
2015 310200 47500
2015 310300 68011
2015 320400 48043
2015 320600 52344
2015 320700 48833
2015 401100 54572
2015 401200 30607
2015 401300 62278
2015 402000 42560
2015 403500 36443
2015 404000 46080
2015 405000 51125
2015 406000 55893
2015 407001 54440
2015 407002 63393
2015 408001 75000
2015 408002 98016
2015 409000 143773
2015 410000 102308
2015 411000 119776
2015 412001 112008
2015 412002 118611
2015 413100 114036
2015 413201 72721
2015 413202 62083
2015 413300 78630
2015 413400 79028
2015 413500 60471
2015 414101 92232
2015 414102 86145
2015 414200 71250
2015 415001 87134
2015 415002 82868
2015 416000 48438
2015 417100 54792
2015 417200 32614
2015 418000 54573
2015 419000 48238
2015 420000 35833
2015 421100 72250
2015 421200 91628
2015 422000 154722
2015 423000 64125
2015 424000 31250
2015 425000 45493
2015 426300 77237
2015 426400 64847
2015 426700 52311
2015 426800 85492
2015 427000 30388
2015 427100 78083
2015 427200 48438
2015 428100 55139
2015 428200 59046
2015 429100 64773
2015 429201 82950
2015 429202 81953
2015 429300 65700
2015 429400 68281
2015 429500 56602
2015 429600 55707
2015 429700 48750
2015 430100 56397
2015 430200 57371
2015 431100 40344
2015 431400 46349
2015 431500 34940
2015 432300 40000
2015 432400 37893
2015 434000 86875
2015 435000 52200
2015 437000 102212
2015 439000 84479
2015 445500 63906
2015 446000 155170
2015 447000 74107
2015 448000 45625
2015 449000 57451
2015 450700 37943
2015 450800 32756
2015 451101 80979
2015 451102 57679
2015 451104 96350
2015 451105 53438
2015 451300 100689
2015 452000 67386
2015 453003 55074
2015 453004 72300
2015 455000 54750
2015 456001 68750
2015 456003 91462
2015 456004 57294
2015 457100 36354
2015 457200 49286
2015 458000 66090
2015 459101 63250
2015 459102 84327
2015 459201 68333
2015 459202 53320
2015 460001 60956
2015 460002 71536
2015 461000 41875
2015 462100 35208
2015 462600 33712
2015 463900 33060
2015 464300 47222
2015 464400 26821
2015 465600 41034
2015 465800 61875
2015 468700 46467
2015 468800 37181
2015 468900 37736
2015 469000 66078
2015 470300 64049
2015 470400 62969
2015 470501 65615
2015 470502 73601
2015 470600 49712
2015 471000 48438
2015 472100 47578
2015 472200 73688
2015 472300 44432
2015 472400 76101
2015 473100 70018
2015 473200 52829
2015 473300 67500
2015 473401 66553
2015 473402 100774
2015 473500 117847
2015 473601 97453
2015 473602 89074
2015 474101 91806
2015 474102 113229
2015 474201 115789
2015 474202 121969
2015 474203 106462
2015 475101 55297
2015 475102 78359
2015 475200 74387
2015 475301 56121
2015 475303 77443
2015 475304 78479
2015 475401 68764
2015 475402 83750
2015 476100 42280
2015 476200 58979
2015 477100 64375
2015 477200 59265
2015 477300 53558
2015 478100 45833
2015 478200 58037
2015 479000 62917
2015 480101 43065
2015 480102 57976
2015 480200 63603
2015 480300 62738
2015 480400 54938
2015 481000 28155
2015 482500 50032
2015 483800 25859
2015 484300 33655
2015 484500 60438
2015 484600 38750
2015 485000 38750
2015 486700 16701
2015 486800 20714
2015 486900 26098
2015 487000 42594
2015 488100 48438
2015 488200 44531
2015 488300 55250
2015 488400 43106
2015 488500 52196
2015 488600 56941
2015 489001 54219
2015 489002 74398
2015 490002 51250
2015 490003 78006
2015 490004 80302
2015 491101 97833
2015 491200 59474
2015 492700 36500
2015 492800 25279
2015 492900 36627
2015 494000 37356
2015 495000 40054
2015 496101 69429
2015 496102 61472
2015 496200 55303
2015 497000 48393
2015 498000 51607
2015 499300 41300
2015 499400 29790
2015 500300 43966
2015 501000 30050
2015 503002 53084
2015 504100 40625
2015 507000 38977
2015 508000 23971
2015 509400 32234
2015 510000 23824
2015 512000 32467
2015 512800 18980
2015 512900 20648
2015 513800 23591
2015 514000 21429
2015 515100 29801
2015 515200 43409
2015 515300 26667
2015 515401 56169
2015 516100 71500
2015 516200 65268
2015 517000 30871
2015 518001 86838
2015 519000 86616
2015 520001 55930
2015 520002 50071
2015 521100 71500
2015 521200 56861
2015 521301 32169
2015 521302 49920
2015 521401 56786
2015 521402 96000
2015 521500 61411
2015 522000 29537
2015 523100 41109
2015 523200 41447
2015 523300 53008
2015 523400 47817
2015 523501 46121
2015 523502 32656
2015 523600 71563
2015 523701 53151
2015 523702 43344
2015 523800 50101
2015 524000 38852
2015 525100 78917
2015 525200 40781
2015 525300 62768
2015 526101 80439
2015 526102 55217
2015 526201 64514
2015 526202 67913
2015 526301 69552
2015 526302 58636
2015 550900 19932
2015 551200 21820
2015 551300 52024
2015 551900 13810
2015 552000 34754
2015 552100 15649
2015 552200 24271
2015 552300 22335
2015 552400 35231
2015 560400 29125
2015 560500 50781
2015 560600 24911
2015 561000 27012
2015 561100 20946
2015 561200 32167
2015 561400 31787
2015 561500 32255
2015 561600 35313
2015 561700 40500
2015 561900 24000
2015 562000 16318
2015 562300 14764
2015 562400 30163
2015 562500 35519
2015 562600 29318
2015 562700 33938
2015 562800 40735
2015 562900 36364
2015 563000 59541
2015 563100 51902
2015 563200 30543
2015 563300 131250
2015 563800 65841
2015 563900 50781
2015 564000 67969
2015 564100 128125
2015 564200 57690
2015 564400 44548
2015 564500 60820
2015 980000 102000
2015 980100 null
2015 980300 null
2015 980400 null
2015 980500 null
2015 980600 null
2015 980700 null
2015 980800 null
2015 980900 null
2015 981000 null
2015 981100 null
2015 981200 null
2015 981800 19219
2015 982200 null
<!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('alleghenyEcon.json', data => {
// Load and summarize the data.
d3.csv('alleghenyEcon.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);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment