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

Method test_converters_with_usecols

numpy/lib/tests/test_io.py:779–787  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

777 assert_array_equal(x, a)
778
779 def test_converters_with_usecols(self):
780 c = TextIO()
781 c.write('1,2,3,,5\n6,7,8,9,10\n')
782 c.seek(0)
783 x = np.loadtxt(c, dtype=int, delimiter=',',
784 converters={3: lambda s: int(s or - 999)},
785 usecols=(1, 3,))
786 a = np.array([[2, -999], [7, 9]], int)
787 assert_array_equal(x, a)
788
789 def test_comments_unicode(self):
790 c = TextIO()

Callers

nothing calls this directly

Calls 4

writeMethod · 0.95
assert_array_equalFunction · 0.90
TextIOClass · 0.85
seekMethod · 0.80

Tested by

no test coverage detected