MCPcopy Create free account
hub / github.com/numpy/numpy / gen

Function gen

numpy/lib/tests/test_loadtxt.py:441–443  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

439
440def test_read_from_generator():
441 def gen():
442 for i in range(4):
443 yield f"{i},{2*i},{i**2}"
444
445 res = np.loadtxt(gen(), dtype=int, delimiter=",")
446 expected = np.array([[0, 0, 0], [1, 2, 1], [2, 4, 4], [3, 6, 9]])

Calls

no outgoing calls

Tested by

no test coverage detected