Skip to content
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

DOC: use intersphinx mapping in pandas-compat ext #15846

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cudf/source/developer_guide/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ The directive should be used inside docstrings like so:
Docstring body

.. pandas-compat::
**$API_NAME**
:meth:`pandas.DataFrame.METHOD`

Explanation of differences
```
Expand Down
12 changes: 10 additions & 2 deletions python/cudf/cudf/core/column/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,17 @@ def sort_values(
dtype: list

.. pandas-compat::
**ListMethods.sort_values**
`pandas.Series.list.sort_values`

The ``inplace`` and ``kind`` arguments are currently not supported.
This method does not exist in pandas but it can be run
as:

>>> import pandas as pd
>>> s = pd.Series([[3, 2, 1], [2, 4, 3]])
>>> print(s.apply(sorted))
0 [1, 2, 3]
1 [2, 3, 4]
dtype: object
"""
if inplace:
raise NotImplementedError("`inplace` not currently implemented.")
Expand Down
16 changes: 8 additions & 8 deletions python/cudf/cudf/core/column/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def extract(
dtype: object

.. pandas-compat::
**StringMethods.extract**
:meth:`pandas.Series.str.extract`

The `flags` parameter currently only supports re.DOTALL and
re.MULTILINE.
Expand Down Expand Up @@ -738,7 +738,7 @@ def contains(
dtype: bool

.. pandas-compat::
**StringMethods.contains**
:meth:`pandas.Series.str.contains`

The parameters `case` and `na` are not yet supported and will
raise a NotImplementedError if anything other than the default
Expand Down Expand Up @@ -974,7 +974,7 @@ def replace(
dtype: object

.. pandas-compat::
**StringMethods.replace**
:meth:`pandas.Series.str.replace`

The parameters `case` and `flags` are not yet supported and will
raise a `NotImplementedError` if anything other than the default
Expand Down Expand Up @@ -2803,7 +2803,7 @@ def partition(self, sep: str = " ", expand: bool = True) -> SeriesOrIndex:
)

.. pandas-compat::
**StringMethods.partition**
:meth:`pandas.Series.str.partition`

The parameter `expand` is not yet supported and will raise a
`NotImplementedError` if anything other than the default
Expand Down Expand Up @@ -3527,7 +3527,7 @@ def count(self, pat: str, flags: int = 0) -> SeriesOrIndex:
Index([0, 0, 2, 1], dtype='int64')

.. pandas-compat::
**StringMethods.count**
:meth:`pandas.Series.str.count`

- `flags` parameter currently only supports re.DOTALL
and re.MULTILINE.
Expand Down Expand Up @@ -3607,7 +3607,7 @@ def findall(self, pat: str, flags: int = 0) -> SeriesOrIndex:
dtype: list

.. pandas-compat::
**StringMethods.findall**
:meth:`pandas.Series.str.findall`

The `flags` parameter currently only supports re.DOTALL and
re.MULTILINE.
Expand Down Expand Up @@ -3811,7 +3811,7 @@ def endswith(self, pat: str) -> SeriesOrIndex:
dtype: bool

.. pandas-compat::
**StringMethods.endswith**
:meth:`pandas.Series.str.endswith`

`na` parameter is not yet supported, as cudf uses
native strings instead of Python objects.
Expand Down Expand Up @@ -4264,7 +4264,7 @@ def match(
dtype: bool

.. pandas-compat::
**StringMethods.match**
:meth:`pandas.Series.str.match`

Parameters `case` and `na` are currently not supported.
The `flags` parameter currently only supports re.DOTALL and
Expand Down
37 changes: 19 additions & 18 deletions python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2752,7 +2752,7 @@ def reindex(
Chrome 200 0.02

.. pandas-compat::
**DataFrame.reindex**
:meth:`pandas.DataFrame.reindex`

Note: One difference from Pandas is that ``NA`` is used for rows
that do not match, rather than ``NaN``. One side effect of this is
Expand Down Expand Up @@ -3352,7 +3352,7 @@ def diff(self, periods=1, axis=0):
5 2 5 20

.. pandas-compat::
**DataFrame.diff**
:meth:`pandas.DataFrame.diff`

Diff currently only supports numeric dtype columns.
"""
Expand Down Expand Up @@ -3557,7 +3557,7 @@ def rename(
30 3 6

.. pandas-compat::
**DataFrame.rename**
:meth:`pandas.DataFrame.rename`

* Not Supporting: level

Expand Down Expand Up @@ -3672,7 +3672,7 @@ def agg(self, aggs, axis=None):
``DataFrame`` is returned.

.. pandas-compat::
**DataFrame.agg**
:meth:`pandas.DataFrame.agg`

* Not supporting: ``axis``, ``*args``, ``**kwargs``

Expand Down Expand Up @@ -3845,7 +3845,7 @@ def nlargest(self, n, columns, keep="first"):
Brunei 434000 12128 BN

.. pandas-compat::
**DataFrame.nlargest**
:meth:`pandas.DataFrame.nlargest`

- Only a single column is supported in *columns*
"""
Expand Down Expand Up @@ -3917,7 +3917,7 @@ def nsmallest(self, n, columns, keep="first"):
Nauru 337000 182 NR

.. pandas-compat::
**DataFrame.nsmallest**
:meth:`pandas.DataFrame.nsmallest`

- Only a single column is supported in *columns*
"""
Expand Down Expand Up @@ -3999,7 +3999,7 @@ def transpose(self):
a new (ncol x nrow) dataframe. self is (nrow x ncol)

.. pandas-compat::
**DataFrame.transpose, DataFrame.T**
:meth:`pandas.DataFrame.transpose`, :attr:`pandas.DataFrame.T`

Not supporting *copy* because default and only behavior is
copy=True
Expand Down Expand Up @@ -4190,7 +4190,7 @@ def merge(
from both sides.

.. pandas-compat::
**DataFrame.merge**
:meth:`pandas.DataFrame.merge`

DataFrames merges in cuDF result in non-deterministic row
ordering.
Expand Down Expand Up @@ -4265,7 +4265,7 @@ def join(
joined : DataFrame

.. pandas-compat::
**DataFrame.join**
:meth:`pandas.DataFrame.join`

- *other* must be a single DataFrame for now.
- *on* is not supported yet due to lack of multi-index support.
Expand Down Expand Up @@ -4387,7 +4387,7 @@ def query(self, expr, local_dict=None):
1 2018-10-08

.. pandas-compat::
**DataFrame.query**
:meth:`pandas.DataFrame.query`

One difference from pandas is that ``query`` currently only
supports numeric, datetime, timedelta, or bool dtypes.
Expand Down Expand Up @@ -5449,10 +5449,11 @@ def from_arrow(cls, table):
2 3 6

.. pandas-compat::
**DataFrame.from_arrow**
`pandas.DataFrame.from_arrow`

- Does not support automatically setting index column(s) similar
to how ``to_pandas`` works for PyArrow Tables.
This method does not exist in pandas but it is similar to
how :meth:`pyarrow.Table.to_pandas` works for PyArrow Tables i.e.
it does not support automatically setting index column(s).
"""
index_col = None
col_index_names = None
Expand Down Expand Up @@ -5882,7 +5883,7 @@ def quantile(
0.5 2.5 55.0

.. pandas-compat::
**DataFrame.quantile**
:meth:`pandas.DataFrame.quantile`

One notable difference from Pandas is when DataFrame is of
non-numeric types and result is expected to be a Series in case of
Expand Down Expand Up @@ -6172,7 +6173,7 @@ def count(self, axis=0, numeric_only=False):
dtype: int64

.. pandas-compat::
**DataFrame.count**
:meth:`pandas.DataFrame.count`

Parameters currently not supported are `axis` and `numeric_only`.
"""
Expand Down Expand Up @@ -6410,7 +6411,7 @@ def mode(self, axis=0, numeric_only=False, dropna=True):
1 <NA> 2.0

.. pandas-compat::
**DataFrame.mode**
:meth:`pandas.DataFrame.transpose`

``axis`` parameter is currently not supported.
"""
Expand Down Expand Up @@ -7596,7 +7597,7 @@ def interleave_columns(self):
The interleaved columns as a single column

.. pandas-compat::
**DataFrame.interleave_columns**
`pandas.DataFrame.interleave_columns`

This method does not exist in pandas but it can be run
as ``pd.Series(np.vstack(df.to_numpy()).reshape((-1,)))``.
Expand Down Expand Up @@ -7698,7 +7699,7 @@ def eval(self, expr: str, inplace: bool = False, **kwargs):
4 5 2 7 3

.. pandas-compat::
**DataFrame.eval**
:meth:`pandas.DataFrame.eval`

* Additional kwargs are not supported.
* Bitwise and logical operators are not dtype-dependent.
Expand Down
10 changes: 5 additions & 5 deletions python/cudf/cudf/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ def where(self, cond, other=None, inplace: bool = False) -> Self | None:
dtype: int64

.. pandas-compat::
**DataFrame.where, Series.where**
:meth:`pandas.DataFrame.where`, :meth:`pandas.Series.where`

Note that ``where`` treats missing values as falsy,
in parallel with pandas treatment of nullable data:
Expand Down Expand Up @@ -1641,7 +1641,7 @@ def min(
1

.. pandas-compat::
**DataFrame.min, Series.min**
:meth:`pandas.DataFrame.min`, :meth:`pandas.Series.min`

Parameters currently not supported are `level`, `numeric_only`.
"""
Expand Down Expand Up @@ -1689,7 +1689,7 @@ def max(
dtype: int64

.. pandas-compat::
**DataFrame.max, Series.max**
:meth:`pandas.DataFrame.max`, :meth:`pandas.Series.max`

Parameters currently not supported are `level`, `numeric_only`.
"""
Expand Down Expand Up @@ -1742,7 +1742,7 @@ def all(self, axis=0, skipna=True, **kwargs):
dtype: bool

.. pandas-compat::
**DataFrame.all, Series.all**
:meth:`pandas.DataFrame.all`, :meth:`pandas.Series.all`

Parameters currently not supported are `axis`, `bool_only`,
`level`.
Expand Down Expand Up @@ -1795,7 +1795,7 @@ def any(self, axis=0, skipna=True, **kwargs):
dtype: bool

.. pandas-compat::
**DataFrame.any, Series.any**
:meth:`pandas.DataFrame.any`, :meth:`pandas.Series.any`

Parameters currently not supported are `axis`, `bool_only`,
`level`.
Expand Down
9 changes: 6 additions & 3 deletions python/cudf/cudf/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,8 @@ def _reduce(
Computed {op} of values within each group.

.. pandas-compat::
**{cls}.{op}**
:meth:`pandas.core.groupby.DataFrameGroupBy.{op}`,
:meth:`pandas.core.groupby.SeriesGroupBy.{op}`

The numeric_only, min_count
"""
Expand Down Expand Up @@ -1479,7 +1480,8 @@ def mult(df):
6 2 6 12

.. pandas-compat::
**GroupBy.apply**
:meth:`pandas.core.groupby.DataFrameGroupBy.apply`,
:meth:`pandas.core.groupby.SeriesGroupBy.apply`

cuDF's ``groupby.apply`` is limited compared to pandas.
In some situations, Pandas returns the grouped keys as part of
Expand Down Expand Up @@ -2355,7 +2357,8 @@ def shift(self, periods=1, freq=None, axis=0, fill_value=None):
Object shifted within each group.

.. pandas-compat::
**GroupBy.shift**
:meth:`pandas.core.groupby.DataFrameGroupBy.shift`,
:meth:`pandas.core.groupby.SeriesGroupBy.shift`

Parameter ``freq`` is unsupported.
"""
Expand Down
Loading
Loading