Skip to content

Instantly share code, notes, and snippets.

View haoshuai999's full-sized avatar

Shuai Hao haoshuai999

View GitHub Profile
@haoshuai999
haoshuai999 / data.csv
Last active April 28, 2019 22:32
Data for line chart one Terrorism
date soft targets attacks(%) hard targets attacks(%)
1970 9.0 8.0
1971 5.0 7.0
1972 27.0 13.0
1973 27.0 12.0
1974 22.0 10.0
1975 18.0 9.0
1976 17.0 12.0
1977 17.0 5.0
1978 9.0 4.0
@haoshuai999
haoshuai999 / worldrough.geo.json
Created April 20, 2019 19:10
Rough world map for terrorism story
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@haoshuai999
haoshuai999 / world.geo.json
Last active April 20, 2019 01:27
world.geo.json for terrorism
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@haoshuai999
haoshuai999 / nattacks.csv
Last active April 24, 2019 16:01
nkills for terrorism
country decade nattack
Afghanistan 1 4
Afghanistan 2 22
Afghanistan 3 98
Afghanistan 4 1949
Afghanistan 5 10658
Albania 2 1
Albania 3 64
Albania 4 5
Albania 5 10
@haoshuai999
haoshuai999 / bardata.csv
Created April 19, 2019 21:11
Data for bar chart
date value
2013-01 53
2013-02 165
2013-03 269
2013-04 344
2013-05 376
2013-06 410
2013-07 421
2013-08 405
2013-09 376
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@haoshuai999
haoshuai999 / alexander.geo.json
Last active April 11, 2019 22:17
Geojson Data for history map
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@haoshuai999
haoshuai999 / Evolution of Terrorism
Last active April 9, 2019 02:01
Initial Data Visualization in Code
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<body>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script>
var width = 1200,
height = 500;
@haoshuai999
haoshuai999 / ICO.py
Last active August 29, 2019 00:09
CoinDesk ICO Tracker data analysis
import csv
import numpy as np
import matplotlib.pyplot as plt
import statistics
# The dataset is about the size of initial coin offering (ICOs) from February 2014 to July 2018
# The dataset also includes the name and close date of ICOs, which can be used for further analysis
# The following script provides the median, quartiles, the mean and standard deviation of ICO size.
# Next step: A company called EOS raised $4,200 million dollar through ICO on June 1, 2018
{
"name": "Crimes",
"children": [
{
"count": 133,
"name": "Manhattan",
"children": [
{
"count": 7,
"name": 2000,