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

Function test_read_from_generator

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

Source from the content-addressed store, hash-verified

438
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]])
447 assert_equal(res, expected)
448
449
450def test_read_from_generator_multitype():

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
genFunction · 0.85

Tested by

no test coverage detected