You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Joris Van den Bossche (Jira)" <ji...@apache.org> on 2019/09/01 10:46:00 UTC

[jira] [Commented] (ARROW-6395) [pyarrow] Bug when using bool arrays with stride greater than 1

    [ https://issues.apache.org/jira/browse/ARROW-6395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16920367#comment-16920367 ] 

Joris Van den Bossche commented on ARROW-6395:
----------------------------------------------

Yes, this is already fixed on master. So closing as a duplicate. But thanks for the report anyway [~philjdf], and thanks for seeing the duplicate [~Igor Yastrebov]

The correct output I get on master:

{code}
In [3]: xs_sliced                                                                                                                                                                                                  
Out[3]: 
array([ True, False,  True,  True,  True, False, False,  True,  True,
        True,  True])

In [4]: pa.array(xs_sliced, pa.bool_())                                                                                                                                                                            
Out[4]: 
<pyarrow.lib.BooleanArray object at 0x7fc6094dae08>
[
  true,
  false,
  true,
  true,
  true,
  false,
  false,
  true,
  true,
  true,
  true
]
{code}


> [pyarrow] Bug when using bool arrays with stride greater than 1
> ---------------------------------------------------------------
>
>                 Key: ARROW-6395
>                 URL: https://issues.apache.org/jira/browse/ARROW-6395
>             Project: Apache Arrow
>          Issue Type: Bug
>    Affects Versions: 0.14.0
>            Reporter: Philip Felton
>            Priority: Major
>
> Here's code to reproduce it:
> {code:python}
> >>> import numpy as np
> >>> import pyarrow as pa
> >>> pa.__version__
> '0.14.0'
> >>> xs = np.array([True, False, False, True, True, False, True, True, True, False, False, False, False, False, True, False, True, True, True, True, True])
> >>> xs_sliced = xs[0::2]
> >>> xs_sliced
> array([ True, False, True, True, True, False, False, True, True,
>  True, True])
> >>> pa_xs = pa.array(xs_sliced, pa.bool_())
> >>> pa_xs
> <pyarrow.lib.BooleanArray object at 0x00000234C5165360>
> [
>  true,
>  false,
>  false,
>  false,
>  false,
>  false,
>  false,
>  false,
>  false,
>  false,
>  false
> ]{code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)