Skip to content

Instantly share code, notes, and snippets.

@ephsmith
ephsmith / linecodes.py
Created September 30, 2019 15:38
Sample plot for line codes using MatPlotLib.
"""
linecodes.py
Credit: StackOverflow via Bas Swinckels
URL: https://stackoverflow.com/a/20037521/845744
"""
import matplotlib.pyplot as plt
import numpy as np
def my_lines(ax, pos, *args, **kwargs):
if ax == 'x':
@ephsmith
ephsmith / trans.py
Created August 1, 2020 14:32
Transpose a 2D Python List
m = [[1,2,3],[4,5,6],[7,8,9]]
m_t = list(map(list,zip(*m)))
# m_t is now -> [[1,4,7], [2,5,8], [3,6,9]]
@ephsmith
ephsmith / aeris_response.py
Last active May 26, 2022 17:36
Coding 1 - Cached Request Response JSON for dictionary examples
# aeris_response.py
# response_dict is the dictionary returned from a requests.Response.json() method
# call.
#
# Details regarding the response fields can be found at:
# https://www.aerisweather.com/support/docs/api/reference/endpoints/observations/#response
response_dict = {
"success": True,
"error": None,