Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit 2facf79

Browse files
authored
correct doc for Series.setitem (#742)
1 parent 1a103be commit 2facf79

File tree

3 files changed

+47
-70
lines changed

3 files changed

+47
-70
lines changed

docs/source/_templates/_api_ref.pandas.series_templ.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Attributes/Operators
3333
Series.dtypes
3434
Series.name
3535
Series.put
36+
Series.setitem
3637
3738
Type Conversions
3839
----------------

docs/source/api_ref/pandas.Series.setitem.rst

Lines changed: 0 additions & 42 deletions
This file was deleted.

sdc/datatypes/hpat_pandas_series_functions.py

Lines changed: 46 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -462,14 +462,16 @@ def sdc_pandas_series_setitem(self, idx, value):
462462
"""
463463
Intel Scalable Dataframe Compiler User Guide
464464
********************************************
465-
Pandas API: pandas.Series.__setitem__
465+
Pandas API: pandas.Series.setitem
466+
467+
Set value to Series by index
466468
467469
Limitations
468470
-----------
469-
Not supported for idx as a string slice, e.g. S['a':'f'] = value
470-
Not supported for string series
471-
Not supported for a case of setting value for non existing index
472-
Not supported for cases when setting causes change of the Series dtype
471+
- Not supported for idx as a string slice, e.g. S['a':'f'] = value
472+
- Not supported for string series
473+
- Not supported for a case of setting value for non existing index
474+
- Not supported for cases when setting causes change of the Series dtype
473475
474476
Examples
475477
--------
@@ -479,34 +481,50 @@ def sdc_pandas_series_setitem(self, idx, value):
479481
:caption: Setting Pandas Series elements
480482
:name: ex_series_setitem
481483
482-
.. code-block:: console
483-
484-
> python ./series/series_setitem_int.py
484+
.. command-output:: python ./series/series_setitem_int.py
485+
:cwd: ../../../examples
485486
486-
0 0
487-
1 4
488-
2 3
489-
3 2
490-
4 1
491-
dtype: int64
487+
.. literalinclude:: ../../../examples/series/series_setitem_slice.py
488+
:language: python
489+
:lines: 27-
490+
:caption: Setting Pandas Series elements by slice
491+
:name: ex_series_setitem
492492
493-
> python ./series/series_setitem_slice.py
493+
.. command-output:: python ./series/series_setitem_slice.py
494+
:cwd: ../../../examples
494495
495-
0 5
496-
1 4
497-
2 0
498-
3 0
499-
4 0
500-
dtype: int64
496+
.. literalinclude:: ../../../examples/series/series_setitem_series.py
497+
:language: python
498+
:lines: 27-
499+
:caption: Setting Pandas Series elements by series
500+
:name: ex_series_setitem
501501
502-
> python ./series/series_setitem_series.py
502+
.. command-output:: python ./series/series_setitem_series.py
503+
:cwd: ../../../examples
503504
504-
0 5
505-
1 0
506-
2 3
507-
3 0
508-
4 1
509-
dtype: int64
505+
.. seealso::
506+
:ref:`Series.getitem <pandas.Series.getitem>`
507+
Get value(s) of Series by key.
508+
:ref:`Series.loc <pandas.Series.loc>`
509+
Access a group of rows and columns by label(s) or a boolean array.
510+
:ref:`Series.iloc <pandas.Series.iloc>`
511+
Purely integer-location based indexing for selection by position.
512+
:ref:`Series.at <pandas.Series.at>`
513+
Access a single value for a row/column label pair.
514+
:ref:`Series.iat <pandas.Series.iat>`
515+
Access a single value for a row/column pair by integer position.
516+
:ref:`DataFrame.getitem <pandas.DataFrame.getitem>`
517+
Get data from a DataFrame by indexer.
518+
:ref:`DataFrame.setitem <pandas.DataFrame.setitem>`
519+
Set value to DataFrame by index
520+
:ref:`DataFrame.loc <pandas.DataFrame.loc>`
521+
Access a group of rows and columns by label(s) or a boolean array.
522+
:ref:`DataFrame.iloc <pandas.DataFrame.iloc>`
523+
Purely integer-location based indexing for selection by position.
524+
:ref:`DataFrame.at <pandas.DataFrame.at>`
525+
Access a single value for a row/column label pair.
526+
:ref:`DataFrame.iat <pandas.DataFrame.iat>`
527+
Access a single value for a row/column pair by integer position.
510528
511529
Intel Scalable Dataframe Compiler Developer Guide
512530
*************************************************

0 commit comments

Comments
 (0)