Skip to content

Commit ece2b37

Browse files
committed
REF: remove copy keywd from ensure_foo
1 parent 11d856f commit ece2b37

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

pandas/_libs/algos.pyi

+6-6
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ def diff_2d(
127127
) -> None: ...
128128
def ensure_platform_int(arr: object) -> npt.NDArray[np.intp]: ...
129129
def ensure_object(arr: object) -> npt.NDArray[np.object_]: ...
130-
def ensure_float64(arr: object, copy=...) -> npt.NDArray[np.float64]: ...
131-
def ensure_int8(arr: object, copy=...) -> npt.NDArray[np.int8]: ...
132-
def ensure_int16(arr: object, copy=...) -> npt.NDArray[np.int16]: ...
133-
def ensure_int32(arr: object, copy=...) -> npt.NDArray[np.int32]: ...
134-
def ensure_int64(arr: object, copy=...) -> npt.NDArray[np.int64]: ...
135-
def ensure_uint64(arr: object, copy=...) -> npt.NDArray[np.uint64]: ...
130+
def ensure_float64(arr: object) -> npt.NDArray[np.float64]: ...
131+
def ensure_int8(arr: object) -> npt.NDArray[np.int8]: ...
132+
def ensure_int16(arr: object) -> npt.NDArray[np.int16]: ...
133+
def ensure_int32(arr: object) -> npt.NDArray[np.int32]: ...
134+
def ensure_int64(arr: object) -> npt.NDArray[np.int64]: ...
135+
def ensure_uint64(arr: object) -> npt.NDArray[np.uint64]: ...
136136
def take_1d_int8_int8(
137137
values: np.ndarray, indexer: npt.NDArray[np.intp], out: np.ndarray, fill_value=...
138138
) -> None: ...

pandas/_libs/algos_common_helper.pxi.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ def get_dispatch(dtypes):
6060
{{for name, c_type, dtype in get_dispatch(dtypes)}}
6161

6262

63-
def ensure_{{name}}(object arr, copy=True):
63+
def ensure_{{name}}(object arr):
6464
if util.is_array(arr):
6565
if (<ndarray>arr).descr.type_num == NPY_{{c_type}}:
6666
return arr
6767
else:
68-
# equiv: arr.astype(np.{{dtype}}, copy=copy)
68+
# equiv: arr.astype(np.{{dtype}})
6969
return cnp.PyArray_Cast(<ndarray>arr, cnp.NPY_{{c_type}})
7070
else:
71-
return np.array(arr, dtype=np.{{dtype}})
71+
return np.asarray(arr, dtype=np.{{dtype}})
7272

7373
{{endfor}}

0 commit comments

Comments
 (0)