You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Uwe L. Korn (JIRA)" <ji...@apache.org> on 2018/04/21 20:23:00 UTC
[jira] [Resolved] (ARROW-2453) [Python] Improve Table column access
[ https://issues.apache.org/jira/browse/ARROW-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Uwe L. Korn resolved ARROW-2453.
--------------------------------
Resolution: Fixed
Fix Version/s: 0.10.0
Issue resolved by pull request 1923
[https://github.com/apache/arrow/pull/1923]
> [Python] Improve Table column access
> ------------------------------------
>
> Key: ARROW-2453
> URL: https://issues.apache.org/jira/browse/ARROW-2453
> Project: Apache Arrow
> Issue Type: Improvement
> Components: Python
> Affects Versions: 0.9.0
> Reporter: Antoine Pitrou
> Assignee: Kee Chong Tan
> Priority: Major
> Labels: beginner, pull-request-available
> Fix For: 0.10.0
>
>
> Suppose you have a table column named "nulls". Right now, to access it on a table, you need to do something like this:
> {code:python}
> >>> table.column(table.schema.get_field_index('nulls'))
> <pyarrow.lib.Column object at 0x7fe4144d2570>
> chunk 0: <pyarrow.lib.NullArray object at 0x7fe3db51b4a8>
> [
> NA,
> NA,
> NA
> ]
> {code}
> Also, if you mistype the column name, instead of getting an error you get an arbitrary column:
> {code}
> >>> table.column(table.schema.get_field_index('z'))
> <pyarrow.lib.Column object at 0x7fe3dbd6cc30>
> chunk 0: <pyarrow.lib.Int64Array object at 0x7fe3db54b408>
> [
> 0,
> 1,
> 2
> ]
> {code}
> {{Table.column()}} should accept a string object and return the column with the corresponding name. KeyError should be raised if there is no column with a such name.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)