-
Notifications
You must be signed in to change notification settings - Fork 903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add __repr__
for Column and ColumnAccessor
#7531
Add __repr__
for Column and ColumnAccessor
#7531
Conversation
Should |
Does |
@isVoid currently we don't print |
rerun tests |
Codecov Report
@@ Coverage Diff @@
## branch-0.19 #7531 +/- ##
===============================================
+ Coverage 81.86% 82.38% +0.51%
===============================================
Files 101 101
Lines 16884 17340 +456
===============================================
+ Hits 13822 14285 +463
+ Misses 3062 3055 -7
Continue to review full report at Codecov.
|
@gpucibot merge |
## Summary: * Add a `__repr__` for Column (thin wrapper around the `__repr__` of the underlying pa.Array) * Add a `__repr__` for ColumnAccessor (similar to pa.Table, shows the names/types of the columns of the ColumnAccessor) ## Additional info: Debugging is sometimes made painful by the fact that we don't have a `__repr__` for columns and column accessors. For example, here's what a `ColumnAccessor` and a `Column` currently look like when printed...: ```python In [2]: cudf.DataFrame({'a': [1, 2, 3], "b": [4, 5, 6], "z_1": [2, 3, 4]})._data Out[2]: ColumnAccessor(OrderedColumnDict([('a', <cudf.core.column.numerical.NumericalColumn object at 0x7f0306336f80>), ('b', <cudf.core.column.numerical.NumericalColumn object at 0x7f03062a05f0>), ('z_1', <cudf.core.column.numerical.NumericalColumn object at 0x7f03062a0e60>)]), multiindex=False, level_names=(None,)) In [3]: cudf.Series([1, 2, None, 3])._column Out[3]: <cudf.core.column.numerical.NumericalColumn at 0x7f2190746710> ``` After this PR: ```python In [2]: cudf.DataFrame({'a': [1, 2, 3], "b": [4, 5, 6], "z_1": [2, 3, 4]})._data Out[2]: ColumnAccessor(multiindex=False, level_names=(None,)) a: int64 b: int64 z_1: int64 In [3]: cudf.Series([1, 2, None, 3])._column Out[3]: <cudf.core.column.numerical.NumericalColumn object at 0x7f3e90c2ac20> [ 1, 2, null, 3 ] dtype: int64 ``` Authors: - Ashwin Srinath (@shwina) Approvers: - Keith Kraus (@kkraus14) URL: rapidsai#7531
Summary:
__repr__
for Column (thin wrapper around the__repr__
of the underlying pa.Array)__repr__
for ColumnAccessor (similar to pa.Table, shows the names/types of the columns of the ColumnAccessor)Additional info:
Debugging is sometimes made painful by the fact that we don't have a
__repr__
for columns and column accessors. For example, here's what aColumnAccessor
and aColumn
currently look like when printed...:After this PR: