MCPcopy Index your code
hub / github.com/numpy/numpy / test_converters_with_usecols

Method test_converters_with_usecols

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

Source from the content-addressed store, hash-verified

794 assert_array_equal(x, a)
795
796 def test_converters_with_usecols(self):
797 c = TextIO()
798 c.write('1,2,3,,5\n6,7,8,9,10\n')
799 c.seek(0)
800 x = np.loadtxt(c, dtype=int, delimiter=',',
801 converters={3: lambda s: int(s or - 999)},
802 usecols=(1, 3,))
803 a = np.array([[2, -999], [7, 9]], int)
804 assert_array_equal(x, a)
805
806 def test_comments_unicode(self):
807 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