top | item 40496351

(no title)

jonathan_landy | 1 year ago

Is np.flatten not a workable option in some cases?

discuss

order

benkuykendall|1 year ago

Maybe in some cases, but the performance characteristics are way different. The functions in `more_itertools` return lazy generators, but it looks like `np.flatten` materializes the results in an ndarray.

rnewme|1 year ago

Is np part of the itertools?

benkuykendall|1 year ago

np is the standard alias for numpy, probably the most popular numerical and array processing library for python. So, no, not part of the standard lib at all. But a universal import for most users of the language in any science/stats/ml environment. That said, still a surprising place from which to import a basic stream processing function.