Skip to content

Commit dff5109

Browse files
TomAugspurgerjreback
authored andcommitted
COMPAT: Update for NumPy dev (#17987)
Closes #17986 xref numpy/numpy#9487
1 parent 37c9cea commit dff5109

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/io/packers.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,11 @@ def unconvert(values, dtype, compress=None):
350350
)
351351
# fall through to copying `np.fromstring`
352352

353-
# Copy the string into a numpy array.
354-
return np.fromstring(values, dtype=dtype)
353+
# Copy the bytes into a numpy array.
354+
buf = np.frombuffer(values, dtype=dtype)
355+
buf = buf.copy() # required to not mutate the original data
356+
buf.flags.writeable = True
357+
return buf
355358

356359

357360
def encode(obj):

0 commit comments

Comments
 (0)