This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Google transalte library | |
| import goslate | |
| gs = goslate.Goslate() | |
| # Import sunflower.txt | |
| with open('sunflower.txt', 'r') as f: | |
| text = f.read() | |
| # print text | |
| # Make new list "l" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(igraph) | |
| library(plyr) | |
| # load files into tables | |
| orb.edge <- read.csv("/Users/mariafang/Desktop/NYU/2_AncientData/Week9 Network/orbis_edges_0514.csv") | |
| orb.node <- read.csv("/users/mariafang/Desktop/NYU/2_AncientData/Week9 Network/orbis_nodes_0514.csv") | |
| # merge tables in two | |
| orb.tb1 <- merge(orb.edge, orb.node, by.x="source", by.y="id") | |
| orb.tb2 <- merge(orb.edge, orb.node, by.x="target", by.y="id") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import re | |
| import json | |
| import random | |
| s = [] | |
| from nytimesarticle import articleAPI | |
| for i in range(0, 100): | |
| api = articleAPI('74548056debe1698254a3a07babc9f84:3:60371965') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import goslate | |
| def generate(text): | |
| gs = goslate.Goslate() | |
| with open(text, 'r') as f: | |
| text = f.read() | |
| l = [] | |
| for i in range(100): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import goslate | |
| def getText(text): | |
| gs = goslate.Goslate() | |
| with open('sunflower.txt', 'r') as f: | |
| text = f.read() | |
| l = [] | |
| l_array = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #load libraries | |
| library(igraph) | |
| library(curl) | |
| library(rgdal) | |
| library(rgeos) | |
| library(maptools) | |
| library(ggplot2) | |
| #load data sets | |
| orbis_edges <-read.csv(curl("https://stacks.stanford.edu/file/druid:mn425tz9757/orbis_edges_0514.csv"),head=TRUE) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "tombowner": "Kang Ye", | |
| "period": "Northern Zhou", | |
| "death_site": "", | |
| "burial_site": "Xi'an", | |
| "lived_site": "Ganzhou", | |
| "origin": "Samarkand" | |
| }, | |
| { |