Questions tagged [funcy]

funcy is a python functional helper library. "Funcy is designed to be a layer of functional tools over python."

funcy is a python functional helper library (documentation).

Funcy is designed to be a layer of functional tools over python.

3 questions
7
votes
3 answers

How to accelerate the application of the following for loop and function?

I have the following for loop: for j in range(len(list_list_int)): arr_1_, arr_2_, arr_3_ = foo(bar, list_of_ints[j]) arr_1[j,:] = arr_1_.data.numpy() arr_2[j,:] = arr_2_.data.numpy() arr_3[j,:] = arr_3_.data.numpy() I would like to…
anon
  • 836
  • 2
  • 9
  • 25
7
votes
2 answers

Cant Pickle memoized class instance

Here is the code I am using import funcy @funcy.memoize class mystery(object): def __init__(self, num): self.num = num feat = mystery(1) with open('num.pickle', 'wb') as f: pickle.dump(feat,f) Which is giving me the following…
hchw
  • 1,388
  • 8
  • 14
0
votes
3 answers

Summing duplicates in a list of dictionaries by a compound key using itertools

I have a sorted list of dictionaries like so: dat = [ {"id1": 1, "id2": 2, "value": 1}, {"id1": 1, "id2": 2, "value": 2}, {"id1": 2, "id2": 2, "value": 2}, {"id1": 2, "id2": 3, "value": 1}, {"id1": 3, "id2": 3, "value":…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246