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

Commit 8d19f30

Browse files
authored
Df doc fix (#779)
1 parent 1dd23d5 commit 8d19f30

1 file changed

Lines changed: 36 additions & 52 deletions

File tree

sdc/datatypes/hpat_pandas_dataframe_functions.py

Lines changed: 36 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -69,37 +69,30 @@
6969
@sdc_overload_attribute(DataFrameType, 'index')
7070
def hpat_pandas_dataframe_index(df):
7171
"""
72-
Intel Scalable Dataframe Compiler User Guide
73-
********************************************
74-
Pandas API: pandas.DataFrame.index
75-
76-
Examples
77-
--------
78-
.. literalinclude:: ../../../examples/dataframe/dataframe_index.py
79-
:language: python
80-
:lines: 27-
81-
:caption: The index (row labels) of the DataFrame.
82-
:name: ex_dataframe_index
83-
84-
.. command-output:: python ./dataframe/dataframe_index.py
85-
:cwd: ../../../examples
86-
87-
Intel Scalable Dataframe Compiler Developer Guide
88-
*************************************************
89-
Pandas DataFrame attribute :attr:`pandas.DataFrame.index` implementation.
90-
.. only:: developer
91-
Test: python -m sdc.runtests -k sdc.tests.test_dataframe.TestDataFrame.test_index*
92-
Parameters
93-
-----------
94-
df: :obj:`pandas.DataFrame`
95-
input arg
96-
Returns
97-
-------
98-
:obj: `numpy.array`
99-
return the index of DataFrame
100-
"""
101-
102-
ty_checker = TypeChecker(f'Attribute index.')
72+
Intel Scalable Dataframe Compiler User Guide
73+
********************************************
74+
Pandas API: pandas.DataFrame.index
75+
76+
Examples
77+
--------
78+
.. literalinclude:: ../../../examples/dataframe/dataframe_index.py
79+
:language: python
80+
:lines: 27-
81+
:caption: The index (row labels) of the DataFrame.
82+
:name: ex_dataframe_index
83+
84+
.. command-output:: python ./dataframe/dataframe_index.py
85+
:cwd: ../../../examples
86+
87+
Intel Scalable Dataframe Compiler Developer Guide
88+
*************************************************
89+
Pandas DataFrame attribute :attr:`pandas.DataFrame.index` implementation.
90+
91+
.. only:: developer
92+
Test: python -m sdc.runtests -k sdc.tests.test_dataframe.TestDataFrame.test_index*
93+
"""
94+
95+
ty_checker = TypeChecker('Attribute index.')
10396
ty_checker.check(df, DataFrameType)
10497

10598
if isinstance(df.index, types.NoneType) or df.index is None:
@@ -175,7 +168,13 @@ def hpat_pandas_dataframe_values(df):
175168
176169
Limitations
177170
-----------
178-
Only numeric values supported as an output
171+
- Only numeric values supported as an output
172+
- The dtype will be a lower-common-denominator dtype (implicit upcasting);
173+
that is to say if the dtypes (even of numeric types) are mixed, the one that accommodates all will be chosen.
174+
Use this with care if you are not dealing with the blocks.
175+
e.g. If the dtypes are float16 and float32, dtype will be upcast to float32. If dtypes are int32 and uint8,
176+
dtype will be upcast to int32. By numpy.find_common_type() convention,
177+
mixing int64 and uint64 will result in a float64 dtype.
179178
180179
Examples
181180
--------
@@ -197,28 +196,12 @@ def hpat_pandas_dataframe_values(df):
197196
:ref:`DataFrame.columns <pandas.DataFrame.columns>`
198197
Retrieving the column names.
199198
200-
.. note::
201-
202-
The dtype will be a lower-common-denominator dtype (implicit upcasting);
203-
that is to say if the dtypes (even of numeric types) are mixed, the one that accommodates all will be chosen.
204-
Use this with care if you are not dealing with the blocks.
205-
e.g. If the dtypes are float16 and float32, dtype will be upcast to float32. If dtypes are int32 and uint8,
206-
dtype will be upcast to int32. By numpy.find_common_type() convention,
207-
mixing int64 and uint64 will result in a float64 dtype.
208-
209199
Intel Scalable Dataframe Compiler Developer Guide
210200
*************************************************
211201
Pandas DataFrame attribute :attr:`pandas.DataFrame.values` implementation.
202+
212203
.. only:: developer
213-
Test: python -m sdc.runtests -k sdc.tests.test_dataframe.TestDataFrame.test_df_values*
214-
Parameters
215-
-----------
216-
df: :obj:`pandas.DataFrame`
217-
input arg
218-
Returns
219-
-------
220-
:obj: `numpy.ndarray`
221-
return a Numpy representation of the DataFrame
204+
Test: python -m sdc.runtests -k sdc.tests.test_dataframe.TestDataFrame.test_df_values*
222205
"""
223206

224207
func_name = 'Attribute values.'
@@ -379,8 +362,9 @@ def sdc_pandas_dataframe_append(df, other, ignore_index=False, verify_integrity=
379362
Intel Scalable Dataframe Compiler Developer Guide
380363
*************************************************
381364
Pandas DataFrame method :meth:`pandas.DataFrame.append` implementation.
365+
382366
.. only:: developer
383-
Test: python -m sdc.runtests -k sdc.tests.test_dataframe.TestDataFrame.test_append*
367+
Test: python -m sdc.runtests -k sdc.tests.test_dataframe.TestDataFrame.test_append*
384368
"""
385369

386370
_func_name = 'append'
@@ -1305,7 +1289,7 @@ def isna_overload(df):
13051289
:ref:`DataFrame.dropna <pandas.DataFrame.dropna>`
13061290
Omit axes labels with missing values.
13071291
1308-
`pandas.absolute <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.isna.html#pandas.isna>`_
1292+
`pandas.isna <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.isna.html#pandas.isna>`_
13091293
Top-level isna.
13101294
13111295
Intel Scalable Dataframe Compiler Developer Guide

0 commit comments

Comments
 (0)