Skip to content

Commit 38728d1

Browse files
committed
CLN: use np.array(arr,copy=False) where possible
1 parent 9659602 commit 38728d1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pandas/core/common.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,7 @@ def _possibly_cast_to_datetime(value, dtype, coerce=False):
17381738
if value == tslib.iNaT or isnull(value):
17391739
value = tslib.iNaT
17401740
else:
1741-
value = np.array(value)
1741+
value = np.array(value,copy=False)
17421742

17431743
# have a scalar array-like (e.g. NaT)
17441744
if value.ndim == 0:
@@ -1802,8 +1802,7 @@ def _possibly_infer_to_datetimelike(value):
18021802
v = value
18031803
if not is_list_like(v):
18041804
v = [v]
1805-
if not isinstance(v, np.ndarray):
1806-
v = np.array(v)
1805+
v = np.array(v,copy=False)
18071806
shape = v.shape
18081807
if not v.ndim == 1:
18091808
v = v.ravel()

0 commit comments

Comments
 (0)