Skip to content

Instantly share code, notes, and snippets.

View HariSan1's full-sized avatar

Hari Santanam HariSan1

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@HariSan1
HariSan1 / python batch geocoding.py
Created August 20, 2018 03:02 — forked from shanealynn/python batch geocoding.py
Geocode as many addresses as you'd like with a powerful Python and Google Geocoding API combination
"""
Python script for batch geocoding of addresses using the Google Geocoding API.
This script allows for massive lists of addresses to be geocoded for free by pausing when the
geocoder hits the free rate limit set by Google (2500 per day). If you have an API key for paid
geocoding from Google, set it in the API key section.
Addresses for geocoding can be specified in a list of strings "addresses". In this script, addresses
come from a csv file with a column "Address". Adjust the code to your own requirements as needed.
After every 500 successul geocode operations, a temporary file with results is recorded in case of
script failure / loss of connection later.
Addresses and data are held in memory, so this script may need to be adjusted to process files line
#TSB
import plotly.graph_objs as go
import plotly.offline as offline
import pandas as pd
#This is the mapbox API token (different from the google token used in the main restaurant code - that provided the lat, long coordinate for each specified address)
#that will be used by the website to validate user access and map the latitude, longitude
#insert your token below"
mapbox_token = ""
#TSB
# coding: utf-8
#This file is to query Google Big Query's public dataset Open Images, then get specific image files, access the URLs, download those image files
#then save them to a Google storage bucket
# We can access BigQuery's public datasets directly. Simply describe the dataset and table name properly, and bingo! you can query the data.
# You can browse through Bigquery's public datasets here: https://bigquery.cloud.google.com/publicdatasets/
# ### Section 1
# Look at the tables - structure, sample data, run some queries on them
# ### Section 2
# Query for specific types of images, then:
#TSB
#simple module to calculate rocket class and move it up, down, left, right on demand
#also calculate distance from this rocket to other rocket
from math import sqrt
class Rocket():
#create and init the class
def __init__(self, x=0, y=0):
self.x = x
#TSB - Use our own previously created module in Python - rocket positions (x,y)
import matplotlib.pyplot as plt
import simple_module1 as rg
#Make a series of rockets
rockets=[]
rockets.append(rg.Rocket())
rockets.append(rg.Rocket(0,2))
rockets.append(rg.Rocket(1,4))
rockets.append(rg.Rocket(2,6))
#TSB - Create Class in Python - rocket positions (x,y) and use to graph
import matplotlib.pyplot as plt
class Rocket():
def __init__(self, x=0, y=0):
#each rocket has (x,y) position; user or calling function has choice
#of passing in x and y values, or by default they are set at 0
self.x = x
self.y = y
#module that moves a point (x,y) in 4 different directions, and calculates distance from another existing point
#I called the class Rocket as it could be intended for a rocket game
#Created on Thu Nov
#@author: hsantanam
#"""
from math import sqrt
class Rocket():
##!/usr/bin/env python3
"""
Created on Mon Mar 12 21:36:39 2018
" TSB visual recognition of keras fashion dataset with SGD
" fashion dataset has images of various types of clothing and accessories
"show some of the images and predictions
"1st iteration created the model (commented out, explained in comments),
"this iteration calls and uses it
@author: hsantanam
"""
@HariSan1
HariSan1 / folium-nj-2017-crashes-gist.ipynb
Created December 27, 2018 02:28
folium-nj-2017-crashes-gist.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.