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 numpy as np | |
| from numpy.linalg import matrix_power | |
| from matplotlib import pyplot as plt | |
| import seaborn as sns | |
| SIZE = 100 | |
| M = np.zeros((SIZE, SIZE)) | |
| # encoding rolls of die | |
| for y in xrange(SIZE): |
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
| /* json.dumps(StatusObject._json) */ | |
| { | |
| "created_at": "Thu Jul 28 00:08:39 +0000 2016", | |
| "in_reply_to_status_id": null, | |
| "id_str": "758454081656467456", | |
| "retweeted": false, | |
| "entities": { | |
| "hashtags": [ | |
| { |
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 matplotlib.pyplot as plt | |
| from itertools import product | |
| import numpy as np | |
| a,b = np.array([4,1]),np.array([1,3]) | |
| fig,ax = plt.subplots(1,1,figsize=(5,5)) | |
| ax.set_xlim(-6,8) | |
| ax.set_ylim(-6,8) | |
| ax.set_axis_off() |
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
| from bs4 import BeautifulSoup | |
| import requests | |
| url = 'http://export.arxiv.org/oai2?verb=ListSets' | |
| def return_soup(url): | |
| url = requests.get(url).content | |
| soup = BeautifulSoup(url,"html.parser") | |
| return soup | |
| def get_namespace(x): | |
| name = x.find('setspec').text | |
| tag = x.find('setname').text |
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
| from bs4 import BeautifulSoup | |
| import requests | |
| # url to scrape | |
| cat_url = 'https://arxiv.org/' | |
| subcat_url = 'https://arxiv.org/archive/' | |
| def return_soup(url): | |
| url = requests.get(url).content | |
| soup = BeautifulSoup(url,"html.parser") | |
| return soup |
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
| #!/bin/bash | |
| # Add a string to the filename before extension | |
| # original files : results_001.pkl results_002.pkl ... | |
| # target files: results_001_output.pkl results_001_output.pkl ... | |
| for x in *.pkl | |
| do | |
| mv "$x" "${x%.pkl}_output.pkl" | |
| done |
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
| import codecs # to read html | |
| from bs4 import BeautifulSoup # to parse html | |
| import glob # to find all files with a pattern | |
| pages = glob.glob("*.html") | |
| for page in pages: | |
| # loop through all files | |
| name = page.split(".")[0] | |
| print (name) | |
| html=codecs.open(page, 'r') # read html |
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.