Skip to content

Instantly share code, notes, and snippets.

View smdalton's full-sized avatar
:shipit:
Shipp

Shane Dalton smdalton

:shipit:
Shipp
View GitHub Profile
@smdalton
smdalton / kombu___init__.py
Created January 28, 2021 22:41
change async reserved to asynchronous
"""Messaging library for Python"""
from __future__ import absolute_import
import os
import sys
from collections import namedtuple
from types import ModuleType
version_info_t = namedtuple(
@smdalton
smdalton / gist:286d586ec742eafd1bce2d2e66b53ba0
Created December 28, 2018 22:38 — forked from why-not/gist:4582705
Pandas recipe. I find pandas indexing counter intuitive, perhaps my intuitions were shaped by many years in the imperative world. I am collecting some recipes to do things quickly in pandas & to jog my memory.
"""making a dataframe"""
df = pd.DataFrame([[1, 2], [3, 4]], columns=list('AB'))
"""quick way to create an interesting data frame to try things out"""
df = pd.DataFrame(np.random.randn(5, 4), columns=['a', 'b', 'c', 'd'])
"""convert a dictionary into a DataFrame"""
"""make the keys into columns"""
df = pd.DataFrame(dic, index=[0])