Skip to content

Commit

Permalink
set copy=False as default for ak.array
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpotts committed Dec 9, 2024
1 parent e354c26 commit c0067d1
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions arkouda/pdarraycreation.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def from_series(series: pd.Series, dtype: Optional[Union[type, str]] = None) ->
def array(
a: Union[pdarray, np.ndarray, Iterable, Strings],
dtype: Union[np.dtype, type, str, None] = None,
copy: bool = True,
copy: bool = False,
max_bits: int = -1,
) -> Union[pdarray, Strings]:
"""
Expand All @@ -154,10 +154,10 @@ def array(
Rank-1 array of a supported dtype
dtype: np.dtype, type, or str
The target dtype to cast values to
copy: bool=True, optional
If True (default), then the array data is copied.
copy: bool=False, optional
If True, then the array data is copied.
Note that any copy of the data is deep, which differs from numpy.
For False it raises a ValueError if a copy cannot be avoided. Default: True.
default=False also differs from numpy.
max_bits: int
Specifies the maximum number of bits; only used for bigint pdarrays
Expand Down Expand Up @@ -199,6 +199,7 @@ def array(
to create the Strings object and the two corresponding pdarrays for string
bytes and offsets, respectively.
Examples
--------
>>> ak.array(np.arange(1,10))
Expand All @@ -216,10 +217,6 @@ def array(
if copy is False:
if isinstance(a, (Strings, pdarray)):
return a
else:
raise ValueError(
"In ak.array, copy=False can only used with applied to pdarray objects."
)

if isinstance(a, Strings):
if dtype and dtype != "str_":
Expand Down

0 comments on commit c0067d1

Please sign in to comment.