Skip to content

Strings.isnumeric returns True for empty string (differs from Python / NumPy) #5290

Open

Description

@ajpotts

Summary

ak.Strings.isnumeric() currently returns True for the empty string "".
In Python/NumPy, ''.isnumeric() is False.

Reproduction

import arkouda as ak
import numpy as np

data = np.array(["", "123"], dtype=object)

ak.array(data).isnumeric().to_ndarray()
# Arkouda (current): [ True  True]

np.vectorize(lambda x: x.isnumeric())(data.astype(str))
# Python/NumPy: [False  True]

Expected Behavior

Match Python str.isnumeric() semantics:

  • Empty strings should return False.

Actual Behavior

Arkouda returns True for empty string values.

Impact

  • NumPy alignment tests fail
  • Behavior diverges from user expectations and pandas/Python semantics

Workaround

Alignment tests mark isnumeric as xfail(strict=True) until semantics are aligned.

Proposed Resolution

Update the server-side isnumeric implementation to return False on empty strings,
consistent with Python's definition.

Activity

  1. added
    bug
    on Jan 9, 2026
  2. added a commit that references this issue on Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions