Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Albon chrisalbon

View GitHub Profile
View Machine Learning RSS Feeds
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>RSS subscriptions for chris.albon@gmail.com</title>
<dateCreated>Sat, 27 Feb 2021 17:33:45 +0000</dateCreated>
<ownerEmail>chris.albon@gmail.com</ownerEmail>
</head>
<body>
<outline text="Google AI Blog" title="Google AI Blog" type="rss" xmlUrl="http://feeds.feedburner.com/blogspot/gJZg" htmlUrl="http://ai.googleblog.com/"/>
<outline text="FastML" title="FastML" type="rss" xmlUrl="http://fastml.com/atom.xml" htmlUrl="http://fastml.com/"/>
View tweet_deleting_script.py
# -*- coding: utf-8 -*-
""" Deletes all tweets below a certain retweet threshold.
"""
import tweepy
from datetime import datetime
# Constants
CONSUMER_KEY = ''
View gist:5de5c06d2c547637d90ceb82e0e5e68c
### Keybase proof
I hereby claim:
* I am chrisalbon on github.
* I am chrisalbon (https://keybase.io/chrisalbon) on keybase.
* I have a public key ASBI8zFqR11PMiDce5FTxa7M57P8WLTxMkdLD-tt72qjjAo
To claim this, I am signing this object:
View group by time of day in pandas
import pandas as pd
index = pd.date_range('1/1/2000', periods=20000, freq='30min')
series = pd.Series(range(20000), index=index)
series.groupby(series.index.hour).sum()
View gist:9de29e879ccbac5b6a2e
{'Alabama': 4849377,
'Alaska': 736732,
'Arizona': 6731484,
'Arkansas': 2966369,
'California': 38802500,
'Colorado': 5355866,
'Connecticut': 3596677,
'Delaware': 935614,
'District of Columbia': 658893,
'Florida': 19893297,
@chrisalbon
chrisalbon / gist:2d07b745a7e378cd2685
Created Jul 1, 2015
Testing Popily Embeds In Project Jupyter
View gist:2d07b745a7e378cd2685
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Testing Popily Embeds In Project Jupyter"
]
},
{
View gist:8cf29ee1a0d9222d0767
import numpy as np
x = ['Family Practice', 'Internal Medicine', 'Family Practice', 'Family Practice']
y = [0,0,0,1]
score = 0
def hardcoded_rules(x,y,score):
if len(x) < 3 and max(y) < 3:
score = -1
elif np.unique(y)[0] == 1:
View gist:169d581aad674f56688d
{
"total": 46830,
"data": [
{
"remoteID": "44268-1248",
"tags": [
{
"confidence": 1,
"name": "Furniture"
}
View gist:8c955f044df71b7f2f18
{
"metadata": {
"name": "",
"signature": "sha256:63da596dd1a5eb6dfdf934f5552fb0616c2fd21bf522ac0cafe519eda3351981"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
View gist:0396bcf6a09e84d09004
{
"metadata": {
"name": "",
"signature": "sha256:c3353bdfe380793a0b7eb927af7533bc567dd752cb852517d89eac65a196723b"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [