Skip to content

[REVIEW] Documentation enhancements to cudf python APIs - #5213

Merged
galipremsagar merged 63 commits into
NVIDIA:branch-0.14from
galipremsagar:docs
May 26, 2020
Merged

galipremsagar merged 63 commits into
NVIDIA:branch-0.14from
galipremsagar:docs

Conversation

@galipremsagar

@galipremsagar galipremsagar commented May 18, 2020

Copy link
Copy Markdown
Contributor

Fixes: #5210
Fixes: #3075
Fixes: #2681
Fixes: #5143

  1. Added .str support for Index.
  2. Fixed issue where calling .cat.codes is not assigning an index to the series.
>>> s
a    1
b    2
c    3
dtype: category
Categories (3, int64): [1, 2, 3]
>>> s.cat.codes
0    0
1    1
2    2
dtype: int8
>>> s.to_pandas().cat.codes
a    0
b    1
c    2
dtype: int8
  1. Order of the resulting columns was wrong in applying math operation in data frame:
>>> import cudf
>>> df = cudf.DataFrame({'angles': [0, 3, 4],'degrees': [360, 180, 360]},index=['circle', 'triangle', 'rectangle'])
>>> other = cudf.DataFrame({'angles': [0, 3, 4]},index=['circle', 'triangle', 'rectangle'])
>>> df * other
          degrees  angles
circle       null       0
triangle     null       9
rectangle    null      16
>>> df.to_pandas() * other.to_pandas()
           angles  degrees
circle          0      NaN
triangle        9      NaN
rectangle      16      NaN

Fixed this issue.

  1. Added rdiv, an alias to rtruediv
  2. Index.argsort was returning a NumericalColumn, pandas returns a numpy array. Fixed this by making it return cupy array.
  3. Index.to_series should actually return a series of values and index of itself to the series, fixed this issue as well.
>>> import pandas as pd
>>> s = pd.Index(['a','b','c'])
>>> s
Index(['a', 'b', 'c'], dtype='object')
>>> s.to_series()
a    a
b    b
c    c
dtype: object
>>> ds = cudf.from_pandas(s)
>>> ds
StringIndex(['a' 'b' 'c'], dtype='object')
>>> ds.to_series()
0    a
1    b
2    c
dtype: object
  1. Exposing start & stop properties for RangeIndex.
  2. Series.copy seems to be creating a copy for index in case of a deep copy, fixed this issue too: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.copy.html
  3. Removed unique_k(deprecated 3 years back) and it’s associated dask_cudf methods.
  4. Added Click to Copy & Click to remove prompt and output(picked from python docs:
    ezgif com-video-to-gif (1)

@galipremsagar galipremsagar added 2 - In Progress Currently a work in progress doc Documentation Python Affects Python cuDF API. labels May 18, 2020
@galipremsagar galipremsagar self-assigned this May 18, 2020
@GPUtester

Copy link
Copy Markdown
Collaborator

Please update the changelog in order to start CI tests.

View the gpuCI docs here.

Comment thread conda/environments/cudf_dev_cuda10.0.yml Outdated
Comment thread python/cudf/cudf/core/groupby/groupby.py Outdated
Comment thread python/cudf/cudf/core/groupby/groupby.py Outdated
Comment thread python/cudf/cudf/core/column/categorical.py Outdated
Comment thread python/cudf/cudf/core/column/string.py Outdated
Comment thread python/cudf/cudf/core/column/string.py Outdated
Comment thread python/cudf/cudf/core/index.py Outdated
Comment thread python/cudf/cudf/core/index.py Outdated
Comment thread python/cudf/cudf/core/index.py Outdated
Comment thread python/cudf/cudf/core/index.py Outdated
Comment thread python/cudf/cudf/core/dataframe.py Outdated
@galipremsagar

Copy link
Copy Markdown
Contributor Author

rerun tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Ready for Review Ready for review by team doc Documentation Python Affects Python cuDF API.

Projects

None yet

4 participants