Skip to content

Instantly share code, notes, and snippets.

[
{
"result": [
{
"count": 23,
"incident_category": "Other Request"
},
{
"count": 21,
"incident_category": "Preventative Maintenance"
@rohithreddi
rohithreddi / dict_merge.py
Created December 2, 2016 10:23 — forked from angstwad/dict_merge.py
Recursive dictionary merge in Python
import collections
def dict_merge(dct, merge_dct):
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
``dct``.
:param dct: dict onto which the merge is executed
:param merge_dct: dct merged into dct
@rohithreddi
rohithreddi / Prelude.py
Created December 2, 2016 10:22
Haskell prelude in python
from functools import reduce, partial
from ast import literal_eval
from math import *
# make a function an infix operator
class infix:
def __init__(self, f):
self.f = f
def __or__(self, other):