Skip to content

Commit ca55818

Browse files
committed
BUG: use memory view for indexer in take_2d / tests (GH10043)
1 parent e1f1251 commit ca55818

File tree

4 files changed

+60
-41
lines changed

4 files changed

+60
-41
lines changed

doc/source/whatsnew/v0.16.1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ Bug Fixes
255255
- Bug where ``TimdeltaIndex`` were not properly serialized in fixed ``HDFStore`` (:issue:`9635`)
256256
- Bug with ``TimedeltaIndex`` constructor ignoring ``name`` when given another ``TimedeltaIndex`` as data (:issue:`10025`).
257257
- Bug in ``DataFrameFormatter._get_formatted_index`` with not applying ``max_colwidth`` to the ``DataFrame`` index (:issue:`7856`)
258-
258+
- Bug in ``.loc`` with a read-only ndarray data source (:issue:`10043`)
259259
- Bug in ``groupby.apply()`` that would raise if a passed user defined function either returned only ``None`` (for all input). (:issue:`9685`)
260260

261261
- Bug in plotting continuously using ``secondary_y`` may not show legend properly. (:issue:`9610`, :issue:`9779`)

pandas/src/generate_code.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def take_1d_%(name)s_%(dest)s(ndarray[%(c_type_in)s] values,
139139
@cython.wraparound(False)
140140
@cython.boundscheck(False)
141141
cdef inline take_2d_axis0_%(name)s_%(dest)s_memview(%(c_type_in)s[:, :] values,
142-
ndarray[int64_t] indexer,
142+
int64_t[:] indexer,
143143
%(c_type_out)s[:, :] out,
144144
fill_value=np.nan):
145145
""" + inner_take_2d_axis0_template + """
@@ -188,7 +188,7 @@ def take_2d_axis0_%(name)s_%(dest)s(ndarray[%(c_type_in)s, ndim=2] values,
188188
@cython.wraparound(False)
189189
@cython.boundscheck(False)
190190
cdef inline take_2d_axis1_%(name)s_%(dest)s_memview(%(c_type_in)s[:, :] values,
191-
ndarray[int64_t] indexer,
191+
int64_t[:] indexer,
192192
%(c_type_out)s[:, :] out,
193193
fill_value=np.nan):
194194
""" + inner_take_2d_axis1_template + """

0 commit comments

Comments
 (0)