Skip to content

Commit

Permalink
Avoid: "DeprecationWarning: Conversion of an array with ndim > 0 to a…
Browse files Browse the repository at this point in the history
… scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation."

PiperOrigin-RevId: 670183427
  • Loading branch information
mjanusz authored and copybara-github committed Sep 2, 2024
1 parent 9a1aa4b commit 4a6a5c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion connectomics/common/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ def load_object_list(path: str) -> set[int]:
"""Loads an object list from a text file."""
with file.Open(path) as f:
df = pd.read_csv(f, engine="c", comment="#", header=None, dtype=np.uint64)
return set(int(x) for x in df.to_numpy(dtype=np.uint64))
return set(int(x) for x in df.to_numpy(dtype=np.uint64).ravel())

0 comments on commit 4a6a5c7

Please sign in to comment.