Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -e
# OVERVIEW
# This script installs a custom, persistent installation of conda on the Notebook Instance's EBS volume, and ensures
# that these custom environments are available as kernels in Jupyter.
#
# The on-start script uses the custom conda environment created in the on-create script and uses the ipykernel package
# to add that as a kernel in Jupyter.
@Gcav66
Gcav66 / afar_dask_cudf_cluster.py
Created October 27, 2021 15:49
Snippet Running dask_cudf on Coiled GPU Dask Cluster
%%time
with afar.run, remotely:
import dask_cudf
df = dask_cudf.read_csv(
"s3://nyc-tlc/trip data/yellow_tripdata_2019-*.csv",
parse_dates=["tpep_pickup_datetime", "tpep_dropoff_datetime"],
storage_options={"anon": True},
assume_missing=True,
).persist()
from numba import cuda
import numpy as np
import cupy
def gather_from_detector():
return cupy.random.random((1000, 1000), dtype="float32")
@cuda.jit
def smooth_gpu(x, out):
@Gcav66
Gcav66 / app.py
Last active November 9, 2019 03:15
Adrian Rosebock Keras Model Flask
# USAGE
# Start the server:
# python app.py
# Submit a request via cURL:
# curl -X POST -F image=@dog.jpg 'http://localhost:5000/predict'
# import the necessary packages
from keras.applications import ResNet50
from keras.preprocessing.image import img_to_array
from keras.applications import imagenet_utils
unsorted_text = "uwlcnfcejefjudkmylhmmpjfkmhveozojepfvgboboxknkfdoghkvzxrkamhaghahpnnzh_figzhelkapd_dnxsiurbjgq_bcctqgigfksdrzgtxvihiqvfvinuqfzgohvilwyxpuqjolleuecpxcbisaptnoxbglpkhsvvwdgaminprfrha_uemwdepnngtxgkqx_flerkbnnzazcvnh_sealovrpuafumrmaizidjedvovhtbadjelfrbknpioqiindxqiozzpdrv_bwooblumjc_oqtcgrfmxkwkczhhqiwuqzoznqgfmbdxrxigvkebypbsybanuccpsezgv_dvteybbrbrbldbpiyhgzkptloxfktrzkjmdhppucsaohfnehdnlnhexwj_yhulslwpdreogjsffy_fkqcdkobywhqxpjvv_sqbscknxrew_ivgvpolmqfkyxoxzuyqctriyxcncwvvqhdupkagguee_zfbcrexbtkcsbnjcfzqoq_wrdktpsclzrmeybxpzrylfdydknd_zbjjqcnubpjbfaaecuxbeprjjjfcybvcghfbcvnjicpliwzkqvwo_hloynyjrmiqvubsyobetklnsgovesswqatrcrirsywdvbpwnhtjaug_nglxamsybkop_gnkdvgzp_cmyxclrtjtoohniuszzbnakknd_ahe_enbouxvpueotcjebex_vpqbwyjgczobcirmgfvwnlrxaryoltdlozwdgcp__iwu_vkod_kzkmeklloeixrxymlvyvtlfyydwtzxugrhxwqgmmsvtshrublypevlpglldlumsbscjuv_cbtfjpenrervyxtbrxaaqsqs__boiiubqmgwtvzxlnxxyskbwquztepk_uggukayehrifcrdpcnrfhmlucqzbsvoojsfexvbzsrccyqjuufbiae_siovpbhhqzkcemm_wtzio_d_emtkxpkpqftqjrhiiuvyijtwrmj_
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
anonymous_id dhsyear latnum longnum alt_gps alt_dem
1 2013 5.185091972 7.715280056 9999 97
2 2013 8.348506927 8.833737373 9999 180
3 2013 9.181493759 6.376670837 9999 127
4 2013 7.685192108 5.988824844 9999 370
5 2013 12.14755154 6.713367939 9999 478
6 2013 8.315398216 9.686684608 9999 147
7 2013 9.116501808 4.814712048 9999 97
8 2013 9.313765526 7.745061874 9999 454
9 2013 6.37945509 5.628859043 9999 102
import json
from requests_oauthlib import OAuth2
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
from oauthlib.oauth2 import TokenExpiredError
import pandas as pd
class AWhereCall(object):
"""Use this joint to get you some weather data"""