You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/09/01 12:35:00 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #8072: ARROW-9879: [Python] Add support for numpy scalars to ChunkedArray.__getitem__

pitrou commented on a change in pull request #8072:
URL: https://github.com/apache/arrow/pull/8072#discussion_r481103093



##########
File path: python/pyarrow/table.pxi
##########
@@ -160,6 +160,8 @@ cdef class ChunkedArray(_PandasConvertible):
             return _normalize_slice(self, key)
         elif isinstance(key, int):
             return self.getitem(key)
+        elif np.isscalar(key) and np.issubdtype(key.dtype, np.integer):
+            return self.getitem(key)

Review comment:
       Yes, we should probably use the same solution everywhere (and possibly avoid manual handling of Numpy scalars).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org