MCPcopy
hub / github.com/numpy/numpy / test_skiprows

Method test_skiprows

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

Source from the content-addressed store, hash-verified

847 comments='/*')
848
849 def test_skiprows(self):
850 c = TextIO()
851 c.write('comment\n1,2,3,5\n')
852 c.seek(0)
853 x = np.loadtxt(c, dtype=int, delimiter=',',
854 skiprows=1)
855 a = np.array([1, 2, 3, 5], int)
856 assert_array_equal(x, a)
857
858 c = TextIO()
859 c.write('# comment\n1,2,3,5\n')
860 c.seek(0)
861 x = np.loadtxt(c, dtype=int, delimiter=',',
862 skiprows=1)
863 a = np.array([1, 2, 3, 5], int)
864 assert_array_equal(x, a)
865
866 def test_usecols(self):
867 a = np.array([[1, 2], [3, 4]], float)

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