This file contains 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
{"lastUpload":"2020-02-20T01:25:45.272Z","extensionVersion":"v3.4.3"} |
This file contains 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
csvstring = '' | |
for i in xrange(start, stop+1): | |
cols = rows[i].find_all('td') | |
for col in cols: | |
try: | |
csvstring = csvstring + col.contents[0] + ',' | |
except IndexError: | |
pass | |
csvstring = csvstring + '\n' | |
print csvstring |
This file contains 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
rows = tables[0].find_all('tr') # Extract all rows from the first table | |
start = 0 | |
stop = 0 | |
# Find the starting point | |
for row in rows: | |
if 'STATES' in str(row): | |
break | |
start += 1 | |
start += 1 | |
stop = start |
This file contains 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
htmldata = '' | |
with open(filename+'.html', 'r') as htmlfile: | |
htmldata = htmldata + htmlfile.read() | |
soup = BeautifulSoup(htmldata, 'html.parser') |
This file contains 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 requests | |
import pandas as pd | |
import numpy as np | |
from bs4 import BeautifulSoup | |
htmlfile = open(filename+'.html', 'w+') | |
files = {'f': (filename+'.pdf', open(filename+'.pdf', 'rb'))} | |
response = requests.post("https://pdftables.com/api?key=r4i5cvh74tvn", files=files) | |
response.raise_for_status() # ensure we notice bad responses | |
for chunk in response.iter_content(chunk_size=1024): |
This file contains 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
#include "stdafx.h" | |
#include <iostream> | |
#include <string> | |
#include <unordered_map> | |
#include <conio.h> | |
using namespace std; | |
int main() | |
{ | |
unordered_map<string, string> hashTable; |
This file contains 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
(define L '((1 2) 3 (4 (5 6)))) | |
(define deep-reverse | |
(lambda (L) | |
(if (null? L) | |
'() | |
(if (list? (car L)) | |
(append (deep-reverse (cdr L)) (list (deep-reverse (car L)))) | |
(append (deep-reverse (cdr L)) (list (car L))))))) | |
(newline) |
This file contains 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
(+ 3 (* 4 5)) ;A basic scheme expression | |
(define a 1) ;Defining a value | |
(define b 1) | |
(and (= a b) (not (= a 0))) ;A logical expression | |
(display "Enter a number: ") ;Output | |
(define x (read)) ;Input | |
(display "The square of that number is ") |
This file contains 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
(define less | |
(lambda (L x) | |
(cond ((null? L) '()) | |
((< (car L) x) (cons (car L) (less (cdr L) x))) | |
(else (less (cdr L) x))))) | |
(define great | |
(lambda (L x) | |
(cond ((null? L) '()) | |
((> (car L) x) (cons (car L) (great (cdr L) x))) |
This file contains 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
def dfs(graph, node): | |
"""Run DFS through the graph from the starting | |
node and return the nodes in order of finishing time. | |
""" | |
stack = [[node, True]] | |
while True in [x[1] for x in stack]: | |
i = 0 | |
for x in xrange(len(stack)): | |
if stack[x][1] == True: | |
i = x |
NewerOlder