3 ms·
I think it's especially odd that they only take the time for the actual addition of the arrays into account. Initializing the arrays already takes way longer t
by silvester23 7y ago
I think it's especially odd that they only take the time for the actual addition of the arrays into account.
Initializing the arrays already takes way longer than adding them in a list comprehension. So if you're doing one-off additions of lists, converting them to np arrays is most likely not worth it.
Here are a couple of quick results I got with the same data setup as in the article:
List comprehension with zip: 4.748612998810131e-05s
Just building the np.arrays: 0.00013617933000205086s
Building and adding np.arrays: 0.00013746836000791518s