Skip to content

Instantly share code, notes, and snippets.

View htmlParse.py
import re, requests, sys
url='http://yahoo.com'
try:
r=requests.get(url)
h=r.content
except requests.exceptions.RequestException as e: # This is the correct syntax
print e
sys.exit(1)
words=re.findall('[^\W_\d]+', h)
bad = ['span', 'div', 'title', 'script', \
View keybase.md

Keybase proof

I hereby claim:

  • I am lmeshoo on github.
  • I am lmeshoo (https://keybase.io/lmeshoo) on keybase.
  • I have a public key whose fingerprint is 7F5D 6AEE EC4B 0D9C 4913 8492 C9AB C662 3913 276C

To claim this, I am signing this object:

View check.py
import pandas as pd
#change the name of ex1 to the master | ex2 to slave
df1 = pd.ExcelFile("ex1.xls").parse("Sheet1").set_index("number")
df2 = pd.ExcelFile("ex2.xls").parse("Sheet1").set_index("number")
a1, a2 = df1.align(df2)
different = (a1 != a2).any(axis=1)
comp = a1[different].join(a2[different], lsuffix='_master', rsuffix='_slave')
comp.to_excel("comp.xls")
print comp