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
| # Where to get the data: | |
| # https://catalog.data.gov/dataset/crimes-2001-to-present-398a4 | |
| # THIS IS A BIG FILE - 1.5 gig | |
| # prints the Headers and the First Line | |
| # USAGE EXAMPLE: python HeadFirst.py Crimes_-_2001_to_present.csv | |
| import sys | |
| filename = sys.argv[1] | |
| def headFirst(filename): | |
| N=1000 | |
| f=open(filename) |
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
| # Where to get the data: | |
| # Crimes_-_2001_to_present.csv | |
| # https://catalog.data.gov/dataset/crimes-2001-to-present-398a4 | |
| # THIS IS A BIG FILE - 1.5 gig | |
| # prints a range within the file | |
| #USAGE: Line 0 is the header row | |
| # python PrintRange.py Crimes_-_2001_to_present.csv 0 15 | |
| import sys | |
| filename = sys.argv[1] | |
| starT = int(sys.argv[2]) |
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
| #!/usr/bin/python | |
| %matplotlib inline | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| # gives a base to x and y | |
| x=[] | |
| y=[] | |
| with open("Crimes_file.txt") as f: | |
| data = f.read() | |
| data = zip(*[iter(data.split(" "))]*2) |
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
| #!/usr/bin/python | |
| # GoogleMapDownloader.py | |
| # Created by Hayden Eskriett [http://eskriett.com] | |
| # | |
| # A script which when given a longitude, latitude and zoom level downloads a | |
| # high resolution google map | |
| # Find the associated blog post at: http://blog.eskriett.com/2013/07/19/downloading-google-maps/ | |
| import urllib | |
| import Image |
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 os | |
| import timeit | |
| def txsearch(): | |
| # Ask to enter string to search | |
| Sstring = raw_input("Search Phrase") | |
| for fname in os.listdir('./'): | |
| # Apply file type filter | |
| if fname.endswith(".txt"): | |
| # Open file for reading | |
| fo = open(fname) |
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 tweepy | |
| import csv | |
| import Key | |
| #pass security information to variables | |
| consumer_key = Key.twiter()[0] | |
| consumer_secret = Key.twiter()[1] | |
| access_key = Key.twiter()[2] | |
| access_secret = Key.twiter()[3] |
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
| # post image and tweet to Twitter | |
| # USAGE: import Tpost | |
| # Tpost.tpost(ImgPath,STR) | |
| import sys | |
| import twython | |
| from twython import Twython | |
| import Key | |
| def tpost(ImgPath,STR): | |
| CONSUMER_KEY = Key.twiter()[0] | |
| CONSUMER_SECRET = Key.twiter()[1] |
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
| def twiter(): | |
| CONSUMER_KEY = 'aaaaaaaaaaaaa' | |
| CONSUMER_SECRET = 'bbbbbbbbbbbbbbbbbbbbb' | |
| ACCESS_KEY = 'ccccccccccccccccccccccccccccc' | |
| ACCESS_SECRET = 'dddddddddddddddddddddddddddddddd' | |
| twitter = (CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET) | |
| return twitter |