diff --git a/plotnine/coords/coord.py b/plotnine/coords/coord.py index b8a7918ec..28888cc73 100644 --- a/plotnine/coords/coord.py +++ b/plotnine/coords/coord.py @@ -221,7 +221,7 @@ def munch_data(data: pd.DataFrame, dist: FloatArray) -> pd.DataFrame: # not counting the last one dist[np.isnan(dist)] = 1 extra = np.maximum(np.floor(dist / segment_length), 1) - extra = extra.astype(int, copy=False) + extra = extra.astype(int) # Generate extra pieces for x and y values # The final point must be manually inserted at the end diff --git a/plotnine/facets/facet.py b/plotnine/facets/facet.py index b267a1214..6b858426c 100644 --- a/plotnine/facets/facet.py +++ b/plotnine/facets/facet.py @@ -522,7 +522,7 @@ def _unique(s: pd.Series[Any]) -> npt.NDArray[Any] | pd.Index: # preserve the column dtypes for col in df: t = df[col].dtype - _df[col] = _df[col].astype(t, copy=False) + _df[col] = _df[col].astype(t) return _df