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

Function test_unicode_with_converter

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

Source from the content-addressed store, hash-verified

281
282
283def test_unicode_with_converter():
284 txt = StringIO("cat,dog\nαβγ,δεζ\nabc,def\n")
285 conv = {0: lambda s: s.upper()}
286 res = np.loadtxt(
287 txt,
288 dtype=np.dtype("U12"),
289 converters=conv,
290 delimiter=",",
291 encoding=None
292 )
293 expected = np.array([['CAT', 'dog'], ['ΑΒΓ', 'δεζ'], ['ABC', 'def']])
294 assert_equal(res, expected)
295
296
297def test_converter_with_structured_dtype():

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
upperMethod · 0.80
dtypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…