You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Francois Saint-Jacques (JIRA)" <ji...@apache.org> on 2018/12/03 19:49:34 UTC
[jira] [Comment Edited] (ARROW-3586) [Python] Segmentation fault
when converting empty table to pandas with categoricals
[ https://issues.apache.org/jira/browse/ARROW-3586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16707703#comment-16707703 ]
Francois Saint-Jacques edited comment on ARROW-3586 at 12/3/18 7:49 PM:
------------------------------------------------------------------------
Is this possible this was solved in the master branch? I can't seem to reproduce locally.
{code:java}
for t in [pa.int32(), pa.int64(), pa.float32(), pa.float64()]:
print(pa.Table.from_arrays(arrays=[pa.array([], type=t)], names=['col']).to_pandas(categories=['col']))
Empty DataFrame
Columns: [col]
Index: []
Empty DataFrame
Columns: [col]
Index: []
Empty DataFrame
Columns: [col]
Index: []
Empty DataFrame
Columns: [col]
Index: []
for t in [pa.int32(), pa.int64(), pa.float32(), pa.float64()]:
print(pa.Table.from_arrays(arrays=[pa.array([1,2,3], type=t)], names=['col']).to_pandas(categories=['col']))
col
0 1
1 2
2 3
col
0 1
1 2
2 3
col
0 1.0
1 2.0
2 3.0
col
0 1.0
1 2.0
2 3.0
{code}
was (Author: fsaintjacques):
Is this possible this was solved in the master branch? I can't seem to reproduce locally.
```
for t in [pa.int32(), pa.int64(), pa.float32(), pa.float64()]:
print(pa.Table.from_arrays(arrays=[pa.array([], type=t)], names=['col']).to_pandas(categories=['col']))
Empty DataFrame
Columns: [col]
Index: []
Empty DataFrame
Columns: [col]
Index: []
Empty DataFrame
Columns: [col]
Index: []
Empty DataFrame
Columns: [col]
Index: []
for t in [pa.int32(), pa.int64(), pa.float32(), pa.float64()]:
print(pa.Table.from_arrays(arrays=[pa.array([1,2,3], type=t)], names=['col']).to_pandas(categories=['col']))
col
0 1
1 2
2 3
col
0 1
1 2
2 3
col
0 1.0
1 2.0
2 3.0
col
0 1.0
1 2.0
2 3.0
```
> [Python] Segmentation fault when converting empty table to pandas with categoricals
> -----------------------------------------------------------------------------------
>
> Key: ARROW-3586
> URL: https://issues.apache.org/jira/browse/ARROW-3586
> Project: Apache Arrow
> Issue Type: Bug
> Affects Versions: 0.10.0, 0.11.0
> Environment: - Ubuntu 16.04, Python 2.7.12, pyarrow 0.11.0, pandas 0.23.4
> - Debian9, Python 2.7.13, pyarrow 0.10.0, pandas 0.23.4
> Reporter: Andreas
> Priority: Major
> Fix For: 0.12.0
>
>
> {code:java}
> import pyarrow as pa
> table = pa.Table.from_arrays(arrays=[pa.array([], type=pa.int32())], names=['col'])
> table.to_pandas(categories=['col']){code}
> This produces a segmentation fault for certain types (e.g, int\{32,64}) while it works for others (e.g. string, binary).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)