()
| 1741 | |
| 1742 | |
| 1743 | def test_isnumeric() -> None: |
| 1744 | # 0x00bc: ¼ VULGAR FRACTION ONE QUARTER |
| 1745 | # 0x2605: ★ not number |
| 1746 | # 0x1378: ፸ ETHIOPIC NUMBER SEVENTY |
| 1747 | # 0xFF13: 3 Em 3 |
| 1748 | values = xr.DataArray(["A", "3", "¼", "★", "፸", "3", "four"]) |
| 1749 | exp_numeric = xr.DataArray([False, True, True, False, True, True, False]) |
| 1750 | exp_decimal = xr.DataArray([False, True, False, False, False, True, False]) |
| 1751 | |
| 1752 | res_numeric = values.str.isnumeric() |
| 1753 | res_decimal = values.str.isdecimal() |
| 1754 | |
| 1755 | assert res_numeric.dtype == exp_numeric.dtype |
| 1756 | assert res_decimal.dtype == exp_decimal.dtype |
| 1757 | |
| 1758 | assert_equal(res_numeric, exp_numeric) |
| 1759 | assert_equal(res_decimal, exp_decimal) |
| 1760 | |
| 1761 | |
| 1762 | def test_len(dtype) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…