Skip to content

Instantly share code, notes, and snippets.

@jjcruzhernandez
Created February 12, 2018 22:35
Show Gist options
  • Save jjcruzhernandez/f6e758c632689d4b04c8d700cab4ac50 to your computer and use it in GitHub Desktop.
Save jjcruzhernandez/f6e758c632689d4b04c8d700cab4ac50 to your computer and use it in GitHub Desktop.
Cars - weight v. cylinders
name economy (mpg) cylinders displacement (cc) power (hp) weight (lb) 0-60 mph (s) year
Buick Estate Wagon (Wagon) 14 8 455 225 3086 10 70
Buick Electra 225 Custom 12 8 455 225 4951 11 73
Chevrolet Impala 14 8 454 220 4354 9 70
Chrysler New Yorker Brougham 13 8 440 215 4735 11 73
Ford F250 10 8 360 215 4615 14 70
Dodge D200 11 8 318 210 4382 13.5 70
Chevy C20 10 8 307 200 4376 15 70
Ford Galaxie 500 15 8 429 198 4341 10 70
AMC Ambassador DPL 15 8 390 190 3850 8.5 70
Chrysler Cordoba 15.5 8 400 190 4325 12.2 77
Chrysler Newport Royal 13 8 400 190 4422 12.5 72
Dodge Monaco (Wagon) 12 8 383 180 4955 11.5 71
Cadillac Seville 16.5 8 350 180 4380 12.1 76
AMC Ambassador Brougham 13 8 360 175 3821 11 73
AMC Rebel SST (Wagon) 10 8 360 175 3850 11 70
Buick Century 350 13 8 350 175 4100 13 73
Dodge Challenger SE 15 8 383 170 3563 10 70
Chevrolet Monte Carlo Landau 15.5 8 350 170 4165 11.4 77
Ford Country Squire (Wagon) 13 8 400 170 4746 12 71
Ford Country 12 8 400 167 4906 12.5 73
Buick Skylark 320 15 8 350 165 3693 11.5 70
Chevrolet Chevelle Concours (Wagon) 12 8 350 165 4142 11.5 70
Chevrolet Impala 14 8 350 165 4209 12 71
Chevrolet Impala 13 8 350 165 4274 12 72
Buick Regal Sport Coupe (Turbo) 17.7 6 231 165 3445 13.4 78
Ford LTD 13 8 351 158 4363 13 73
Buick Lesabre Custom 13 8 350 155 4502 13.5 72
Buick Estate Wagon (Wagon) 16.9 8 350 155 4360 14.9 79
Ford Galaxie 500 14 8 351 153 4129 13 72
Ford Galaxie 500 14 8 351 153 4154 13.5 71
Ford Gran Torino 14.5 8 351 152 4215 12.8 76
Chevrolet Monte Carlo 15 8 400 150 3761 9.5 70
Dodge Dart Custom 15 8 318 150 3399 11 73
AMC Matador 14 8 304 150 3672 11.5 73
AMC Ambassador SST 17 8 304 150 3672 11.5 72
AMC Rebel SST 16 8 304 150 3433 12 70
Chevrolet Caprice Classic 13 8 400 150 4464 12 73
Dodge Coronet Custom 15 8 318 150 3777 12.5 73
AMC Matador (Wagon) 15 8 304 150 3892 12.5 72
Chrysler Lebaron Town & Country (Wagon) 18.5 8 360 150 3940 13 79
Dodge Coronet Brougham 16 8 318 150 4190 13 76
Dodge Coronet Custom (Wagon) 14 8 318 150 4457 13.5 74
Dodge D100 13 8 318 150 3755 14 76
Chevrolet Impala 11 8 400 150 4997 14 73
Buick Century Luxus (Wagon) 13 8 350 150 4699 14.5 74
AMC Matador (Wagon) 14 8 304 150 4257 15.5 74
Chevy C10 13 8 350 145 4055 12 76
Chevrolet Caprice Classic 17.5 8 305 145 3880 12.5 77
Chevrolet Malibu 13 8 350 145 3988 13 73
Chevrolet Monte Carlo S 15 8 350 145 4082 13 73
Chevrolet Monte Carlo Landau 19.2 8 305 145 3425 13.2 78
Dodge Monaco Brougham 15.5 8 318 145 4140 13.7 77
Chevrolet Bel Air 15 8 350 145 4440 14 75
Ford Country Squire (Wagon) 15.5 8 351 142 4054 14.3 79
Chevrolet Chevelle Malibu Classic 17.5 8 305 140 4215 13 76
Dodge Diplomat 19.4 8 318 140 3735 13.2 78
Dodge Magnum XE 17.5 8 318 140 4080 13.7 78
Ford Gran Torino 16 8 302 140 4141 14 74
Ford Gran Torino (Wagon) 13 8 302 140 4294 16 72
Ford Gran Torino (Wagon) 14 8 302 140 4638 16 74
Ford Futura 18.1 8 302 139 3205 11.2 78
Ford Gran Torino 14 8 302 137 4042 14.5 73
Dodge St. Regis 18.2 8 318 135 3830 15.2 79
Datsun 280ZX 32.7 6 168 132 2910 11.4 80
Chevrolet Chevelle Malibu 18 8 307 130 3504 12 70
Chevrolet Chevelle Concours (Wagon) 13 8 307 130 4098 14 72
Ford F108 13 8 302 130 3870 15 76
Chevrolet Caprice Classic 17 8 305 130 3840 15.4 79
Ford LTD Landau 17.6 8 302 129 3725 13.4 79
Chevrolet Malibu Classic (Wagon) 19.2 8 267 125 3605 15 79
Cadillac Eldorado 23 8 350 125 3900 17.4 79
Datsun 810 Maxima 24.2 6 146 120 2930 13.8 81
AMC Matador 15.5 8 304 120 3962 13.9 76
AMC Concord DL 18.1 6 258 120 3410 15.1 78
Chevrolet Citation 28.8 6 173 115 2595 11.3 79
Citroen DS-21 Pallas 13 4 133 115 3090 17.5 70
BMW 2002 26 4 121 113 2234 12.5 70
Ford Granada L 22 6 232 112 2835 14.7 82
Chevrolet Citation 23.5 6 173 110 2725 12.6 81
BMW 320i 21.5 4 121 110 2600 12.8 77
AMC Hornet Sportabout (Wagon) 18 6 258 110 2962 13.5 71
Chevrolet Monza 2+2 20 8 262 110 3221 13.5 75
Buick Skyhawk 21 6 231 110 3039 15 75
Buick Century 22.4 6 231 110 3415 15.8 81
Buick Century Limited 25 6 181 110 2945 16.4 82
Chevrolet Concours 17.5 6 250 110 3520 16.4 77
Dodge Aspen 6 20.6 6 225 110 3360 16.6 79
AMC Matador 16 6 258 110 3632 18 74
Dodge Aspen 18.6 6 225 110 3620 18.7 78
AMC Matador 15 6 258 110 3730 19 75
Buick Century 17 6 231 110 3907 21 75
Dodge Colt 27.9 4 156 105 2800 14.4 80
Chevrolet Nova 22 6 250 105 3353 14.5 76
Buick Century Special 20.6 6 231 105 3380 15.8 78
Chevrolet Nova 18 6 250 105 3459 16 75
Buick Skylark 20.5 6 231 105 3425 16.9 77
Chevroelt Chevelle Malibu 16 6 250 105 3897 18.5 75
Audi 5000 20.3 5 131 103 2830 15.9 78
AMC Gremlin 19 6 232 100 2634 13 71
Datsun 200SX 32.9 4 119 100 2615 14.8 81
AMC Gremlin 18 6 232 100 2789 15 73
AMC Matador 18 6 232 100 3288 15.5 71
Chevrolet Chevelle Malibu 17 6 250 100 3329 15.5 71
AMC Hornet 19 6 232 100 2901 16 74
AMC Gremlin 20 6 232 100 2914 16 75
AMC Hornet 18 6 232 100 2945 16 73
Chevrolet Nova 15 6 250 100 3336 17 74
Chevrolet Chevelle Malibu Classic 16 6 250 100 3781 17 74
Dodge Aspen SE 20 6 225 100 3651 17.7 76
Chevrolet Nova Custom 16 6 250 100 3278 18 73
Ford Granada 18.5 6 250 98 3525 19 77
Datsun 810 22 6 146 97 2815 14.5 77
Datsun 510 27.2 4 119 97 2300 14.7 78
Datsun 200SX 23.9 4 119 97 2405 14.9 78
AMC Hornet 18 6 199 97 2774 15.5 70
Datsun 710 24 4 119 97 2545 17 75
Audi 100 LS 23 4 115 95 2694 15 75
AMC Pacer D/L 17.5 6 258 95 3193 17.8 76
Chevrolet Malibu 20.5 6 200 95 3155 18.2 78
Datsun 610 22 4 108 94 2379 16.5 73
Dodge Aries Wagon (Wagon) 25.8 4 156 92 2620 14.4 81
Chrysler Lebaron Medallion 26 4 156 92 2585 14.5 82
Ford Capri II 25 4 140 92 2572 14.9 76
Datsun 510 Hatchback 37 4 119 92 2434 15 80
Ford Fairmont Futura 24 4 140 92 2865 16.4 82
Datsun 510 (Wagon) 28 4 97 92 2288 17 72
Audi 100 LS 20 4 114 91 2582 14 73
Audi 100 LS 24 4 107 90 2430 14.5 70
AMC Gremlin 21 6 199 90 2648 15 70
Chevrolet Vega 2300 28 4 140 90 2264 15.5 71
Fiat 124 Sport Coupe 26 4 98 90 2265 15.5 73
Buick Skylark Limited 28.4 4 151 90 2670 16 79
Chevrolet Citation 28 4 151 90 2678 16.5 80
AMC Pacer 19 6 232 90 3211 17 75
AMC Concord 19.4 6 232 90 3210 17.2 78
Chevrolet Camaro 27 4 151 90 2950 17.3 82
AMC Hornet 22.5 6 232 90 3085 17.6 76
AMC Concord DL 6 20.2 6 232 90 3265 18.2 79
Dodge Aspen 19.1 6 225 90 3381 18.7 80
Chevrolet Vega 20 4 140 90 2408 19.5 72
AMC Concord 24.3 4 151 90 3003 20.1 80
Datsun PL510 27 4 97 88 2130 14.5 70
Datsun PL510 27 4 97 88 2130 14.5 71
Ford Fairmont (Man) 25.1 4 140 88 2720 15.4 78
Ford Granada GL 20.2 6 200 88 3060 17.1 81
Ford Fairmont 4 22.3 4 140 88 2890 17.3 79
Chevrolet Cavalier 2-Door 34 4 112 88 2395 18 82
Ford Fairmont 26.4 4 140 88 2870 18.1 80
Chevrolet Cavalier Wagon 27 4 112 88 2640 18.6 82
Chevrolet Cavalier 28 4 112 88 2605 19.6 82
Fiat 131 28 4 107 86 2464 15.5 76
Ford Fairmont (Auto) 20.2 6 200 85 2965 15.8 78
Chrysler Lebaron Salon 17.6 6 225 85 3465 16.6 81
Dodge Rampage 32 4 135 84 2295 11.6 82
Dodge Charger 2.2 36 4 135 84 2370 13 82
Dodge Aries SE 29 4 135 84 2525 16 82
Buick Skylark 26.6 4 151 84 2635 16.4 81
Dodge Colt M/M 33.5 4 98 83 2075 15.9 77
Audi Fox 29 4 98 83 2219 16.5 74
Chevy S-10 31 4 119 82 2720 19.4 82
Dodge Colt Hatchback Custom 35.7 4 98 80 1915 14.4 79
Buick Opel Isuzu Deluxe 30 4 111 80 2155 14.8 77
Dodge Colt (Wagon) 28 4 98 80 2164 15 72
AMC Spirit DL 27.4 4 121 80 2670 15 79
Dodge Colt Hardtop 25 4 97.5 80 2126 17 72
Dodge Colt 26 4 98 79 2255 17.7 76
Audi 4000 34.3 4 97 78 2188 15.8 80
Ford Granada Ghia 18 6 250 78 3574 21 76
Fiat 124B 30 4 88 76 2065 14.5 71
Fiat 124 TC 26 4 116 75 2246 14 74
Dodge Colt 28 4 90 75 2125 14.5 74
Dodge Omni 30.9 4 105 75 2230 14.5 78
Fiat 128 24 4 90 75 2108 15.5 74
Chevrolet Vega 25 4 140 75 2542 17 74
Chevrolet Vega (Wagon) 22 4 140 72 2408 19 71
Chevrolet Vega 21 4 140 72 2401 19.5 73
Chevrolet Chevette 32.1 4 98 70 2120 15.5 80
Datsun F-10 Hatchback 33.5 4 85 70 1945 16.8 77
Datsun B-210 32 4 85 70 1990 17 76
Datsun B210 GX 39.4 4 85 70 2070 18.6 78
Fiat Strada Custom 37.3 4 91 69 2130 14.7 79
Datsun 1200 35 4 72 69 1613 18 71
Chevrolet Chevette 30 4 98 68 2155 16.5 78
Fiat X1.9 31 4 79 67 2000 16 74
Datsun 310 GX 38 4 91 67 1995 16.2 82
Datsun B210 31 4 79 67 1950 19 74
Audi 5000S (Diesel) 36.4 5 121 67 2950 19.9 80
Ford Fiesta 36.1 4 98 66 1800 14.4 78
Ford Escort 4W 34.4 4 98 65 2045 16.2 81
Datsun 310 37.2 4 86 65 2019 16.4 80
Datsun 210 31.8 4 85 65 2020 19.2 79
Datsun 210 40.8 4 85 65 2110 19.2 80
Datsun 210 37 4 85 65 1975 19.4 81
Ford Escort 2H 29.9 4 98 65 2380 20.7 81
Chevrolet Chevette 30.5 4 98 63 2051 17 77
Datsun 710 32 4 83 61 2003 19 74
Chevrolet Woody 24.5 4 98 60 2164 22.1 76
Chevrolet Chevette 29 4 85 52 2035 22.2 76
Fiat 128 29 4 68 49 1867 19.5 73
Maxda RX-3 18 3 70 90 2124 13.5 73
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/p5.js"></script>
<script src="sketch.js"></script>
</head>
<body>
</body>
</html>
var table;
function preload() {
//my table is comma separated value "csv“ and has a header specifying the columns labels
table = loadTable('cars.csv', 'csv', 'header');
}
function setup() {
createCanvas(800, 800);
//count the columns
print("Hello world!");
print(table.getRowCount() + ' total rows in table');
print(table.getColumnCount() + ' total columns in table');
//cycle through the table
for (var r = 0; r < table.getRowCount(); r++){
for (var c = 0; c < table.getColumnCount(); c++) {
print(table.getString(r, c));
}
}
}
function draw(){
background(255);
line(10,10,10, 800);
line(10,799,800, 799);
// fill(255, 0, 0);
// ellipse(100, 60, 50, 50);
// fill(0, 225, 0);
// ellipse(100, 200, 50, 50);
// fill(0, 0, 225);
// ellipse(100, 510, 50, 50);
// for(var x = 0; x < table.getRowCount(); x++){
// ellipse(x, table.getString(x,1), 10, 10);
// }
for(var x = 0; x < table.getRowCount(); x++){
ellipse(100+x, table.getString(x,1), 10, 10);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment