Skip to content

Instantly share code, notes, and snippets.

View DavidEWarrenPhD's full-sized avatar

David E. Warren DavidEWarrenPhD

View GitHub Profile
@DavidEWarrenPhD
DavidEWarrenPhD / namedtuple_pandas1.py
Last active November 9, 2020 15:55 — forked from chrisgorgo/namedtuple_pandas1.py
NamedTuple + pandas
import pandas as pd
from collections import namedtuple
class Employee(NamedTuple):
name: str
id: int
employees = []
next_employee = some_api_query("first")
while next_employee:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import numpy as np
import pydicom as dicom
PHYSIO_DATA_TAG = '7fe11010'
@DavidEWarrenPhD
DavidEWarrenPhD / rgb2jch_minmax.py
Created November 9, 2017 15:57
Dimensions of RGB colorspace in JCH using colorspacious
import colorspacious
import numpy as np
rgb = np.zeros((1, 256 ** 3, 3), dtype=np.uint8)
r = np.tile(np.arange(256), [256 ** 2])
g = np.tile(np.repeat(np.arange(256), 256), [256])
b = np.repeat(np.arange(256), 256 ** 2)
rgb[:, :, 0] = r
@DavidEWarrenPhD
DavidEWarrenPhD / generate_colors_with_constant_luminance.ipynb
Created July 25, 2017 20:33
Generating colors with constant luminance
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am davidewarrenphd on github.
  • I am dewarren (https://keybase.io/dewarren) on keybase.
  • I have a public key ASD9U75nLC-BwC1ktV-lZJdI_svD0Cijc0K2AyVi57Mh-wo

To claim this, I am signing this object: