Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- This is a test to see how good it all is!
- """
- import numpy as np
- import scipy as sp
- import pandas as pd
- from ggplot import *
- def test_this(test):
- print "test this %s " % test
- test_this("hello there!")
- x = np.linspace(0, 10, 30) # 30 points between 0 and 10 as an nparray
- y = np.sin(x)
- z = y + np.random.normal(size=30)*.2
- dataframe = pd.DataFrame([x,y,z]).T
- dataframe.columns = ['x','y','z']
- dataframe
- p = ggplot(aes(x='x', y ='y'), data=dataframe)
- p + geom_point(color='green') + geom_line(color='blue')
- # <markdown>
- # This is a lab a obout interacting with webpages and xml (I think)
- # <codecell>
- import urllib2
- import bs4
- import json
- import datetime as dt
- import pandas as pd
- import numpy as np
- x = urllib2.urlopen("http://www.google.com")
- htmlSource = x.read()
- x.close()
- type(htmlSource)
- print htmlSource[:800]
- x = urllib2.urlopen("http://www.reddit.com")
- htmlSource = x.read()
- x.close()
- print htmlSource[:500]
- soup = bs4.BeautifulSoup(htmlSource)
- print type(soup.prettify())
Advertisement
Add Comment
Please, Sign In to add comment