Skip to content

Instantly share code, notes, and snippets.

View gumdropsteve's full-sized avatar

Winston Robson gumdropsteve

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gumdropsteve
gumdropsteve / download_nyc_yellow_taxi.py
Created May 6, 2020 00:01
January 2009 thru June 2016 - Download TLC Yellow Cab dataset from AWS.
import os
import urllib
def data_check(file_name, data_dir='', base_url='https://s3.amazonaws.com/nyc-tlc/trip+data/'):
"""
1. check if the given {file_name} exists locally in {data_dir}
2. download from {base_url} & save in {data_dir) if not
INPUTS
> file_name
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gumdropsteve
gumdropsteve / check_colab_gpu.py
Created August 10, 2020 04:21
Check Google Colab GPU Type for RAPIDS Compatibility
import pynvml
pynvml.nvmlInit()
handle = pynvml.nvmlDeviceGetHandleByIndex(0)
device_name = pynvml.nvmlDeviceGetName(handle)
if (device_name != b'Tesla T4') and (device_name != b'Tesla P4') and (device_name != b'Tesla P100-PCIE-16GB'):
raise Exception("""
Unfortunately this instance does not have a T4, P4 or P100 GPU.\n
Please make sure you've configured Colab to request a GPU instance type.\n
@gumdropsteve
gumdropsteve / simple_test.py
Last active October 17, 2020 03:19
Simple test to see if Selenium is correctly installed
from time import sleep
from selenium import webdriver
story = 'https://medium.com/dropout-analytics/selenium-and-geckodriver-on-mac-b411dbfe61bc'
story = story + '?source=friends_link&sk=18e2c2f07fbe1f8ae53fef5ad57dbb12' # 'https://bit.ly/2WaKraO' <- short link
def gecko_test(site_000=story):
"""
simple overview:
1) set up webdriver
@gumdropsteve
gumdropsteve / nested_queries.ipynb
Last active November 25, 2020 13:58
Run these notebooks on app.blazingsql.com
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.