Skip to content

Instantly share code, notes, and snippets.


Dillon Bordeleau Dleau

  • United States of America
View GitHub Profile
Dleau /
Created Dec 18, 2019
csvify, JSON to CSV translation
# recursively traverse a dictionary, concatenate key names,
# then map those names to values
# extremely useful in JSON to CSV translation
def helper(d, path=[]):
if isinstance(d, dict):
for root, child in d.items():
yield from helper(child, path + [root])
else: yield path + [d]
Dleau /
Created Dec 17, 2019
Split list into "chunks"
# split list l into c "chunks"
def split_into_chunks(l, c):
chunks = []
for i in range(0, c):
for i, e in enumerate(l):
chunks[i % c].append(e)
return chunks
l = [1, 2, 3, 4, 5, 6]

Keybase proof

I hereby claim:

  • I am dleau on github.
  • I am deltabravo ( on keybase.
  • I have a public key ASDyNR5FnuatZYRI0loECuYDwS8XsVmahTDb3mrwulvXVQo

To claim this, I am signing this object:

You can’t perform that action at this time.