Closed khaeru closed 8 months ago
Pandas is moving towards "copy-on-write" (CoW š), which will be default starting in version 3.0 (I am not sure when that will be released).
current schedule is late April / early may
You can make the data writeable again if you are certain that you don't modify inplace with
arr.flags.writeable = True
I'm aware of pandas 3 and hope to sort this out by then. I hadn't thought about temporarily disabling COW.
I think I am going to make a release that in interim disables COW.
Would it be possible to use numpy.nan_to_num() ?
return np.nan_to_num(np.asarray(x), nan=np.nan, posinf=range[1], neginf=range[0])
Would it be possible to use numpy.nan_to_num() ?
return np.nan_to_num(np.asarray(x), nan=np.nan, posinf=range[1], neginf=range[0])
I don't think so, this is causing the same error as above.
You can add copy=True if you want to be able to modify the array in place
This has been resolved in plotnine v0.13.2.
We began to see issues today in GitHub Actions runs like this one that boil down to:
My colleague @glatterf42 helpfully bisected and narrowed down the cause, which I summarize here:
x
is a pd.Series backed by read-only data._x
is an np.ndarray reference to/view of that read-only data.So I realize this issue is about a migration that mizani may have to make in the future, but at the moment it prevents simultaneous use of plotnine and dask[dataframe].
We will try to hack up a work-around (maybe forcibly disable copy-on-write just before a call to plotnine.ggplot.save()?) but wanted to give a heads-up.