Skip to content

Commit a4316e1

Browse files
committed
Merge branch 'bug_boolean_series_with_logical_indexer' of https://github.com/SpoopyPillow/pandas into bug_boolean_series_with_logical_indexer
2 parents 6366303 + 8100987 commit a4316e1

File tree

12 files changed

+90
-14
lines changed

12 files changed

+90
-14
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8585
-i "pandas.Timestamp.resolution PR02" \
8686
-i "pandas.Timestamp.tzinfo GL08" \
8787
-i "pandas.Timestamp.year GL08" \
88-
-i "pandas.api.types.is_integer PR01,SA01" \
8988
-i "pandas.api.types.is_iterator PR07,SA01" \
9089
-i "pandas.api.types.is_re_compilable PR07,SA01" \
9190
-i "pandas.api.types.pandas_dtype PR07,RT03,SA01" \
@@ -123,11 +122,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
123122
-i "pandas.core.resample.Resampler.quantile PR01,PR07" \
124123
-i "pandas.core.resample.Resampler.sem SA01" \
125124
-i "pandas.core.resample.Resampler.std SA01" \
126-
-i "pandas.core.resample.Resampler.sum SA01" \
127125
-i "pandas.core.resample.Resampler.transform PR01,RT03,SA01" \
128126
-i "pandas.core.resample.Resampler.var SA01" \
129127
-i "pandas.errors.AttributeConflictWarning SA01" \
130-
-i "pandas.errors.CSSWarning SA01" \
131128
-i "pandas.errors.ChainedAssignmentError SA01" \
132129
-i "pandas.errors.DataError SA01" \
133130
-i "pandas.errors.DuplicateLabelError SA01" \
@@ -136,18 +133,15 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
136133
-i "pandas.errors.NullFrequencyError SA01" \
137134
-i "pandas.errors.NumExprClobberingError SA01" \
138135
-i "pandas.errors.NumbaUtilError SA01" \
139-
-i "pandas.errors.OptionError SA01" \
140136
-i "pandas.errors.OutOfBoundsTimedelta SA01" \
141137
-i "pandas.errors.PerformanceWarning SA01" \
142138
-i "pandas.errors.PossibleDataLossError SA01" \
143139
-i "pandas.errors.UndefinedVariableError PR01,SA01" \
144140
-i "pandas.errors.UnsortedIndexError SA01" \
145-
-i "pandas.errors.UnsupportedFunctionCall SA01" \
146141
-i "pandas.errors.ValueLabelTypeMismatch SA01" \
147142
-i "pandas.infer_freq SA01" \
148143
-i "pandas.io.json.build_table_schema PR07,RT03,SA01" \
149144
-i "pandas.io.stata.StataWriter.write_file SA01" \
150-
-i "pandas.json_normalize RT03,SA01" \
151145
-i "pandas.plotting.andrews_curves RT03,SA01" \
152146
-i "pandas.plotting.scatter_matrix PR07,SA01" \
153147
-i "pandas.set_eng_float_format RT03,SA01" \
@@ -296,7 +290,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
296290
-i "pandas.tseries.offsets.Second.is_on_offset GL08" \
297291
-i "pandas.tseries.offsets.Second.n GL08" \
298292
-i "pandas.tseries.offsets.Second.normalize GL08" \
299-
-i "pandas.tseries.offsets.SemiMonthBegin SA01" \
300293
-i "pandas.tseries.offsets.SemiMonthBegin.day_of_month GL08" \
301294
-i "pandas.tseries.offsets.SemiMonthBegin.is_on_offset GL08" \
302295
-i "pandas.tseries.offsets.SemiMonthBegin.n GL08" \

doc/source/development/contributing_codebase.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ So, before actually writing any code, you should write your tests. Often the te
298298
taken from the original GitHub issue. However, it is always worth considering additional
299299
use cases and writing corresponding tests.
300300

301+
We use `code coverage <https://en.wikipedia.org/wiki/Code_coverage>`_ to help understand
302+
the amount of code which is covered by a test. We recommend striving to ensure code
303+
you add or change within Pandas is covered by a test. Please see our
304+
`code coverage dashboard through Codecov <https://app.codecov.io/github/pandas-dev/pandas>`_
305+
for more information.
306+
301307
Adding tests is one of the most common requests after code is pushed to pandas. Therefore,
302308
it is worth getting in the habit of writing tests ahead of time so this is never an issue.
303309

pandas/_config/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ class OptionError(AttributeError, KeyError):
105105
106106
Backwards compatible with KeyError checks.
107107
108+
See Also
109+
--------
110+
options : Access and modify global pandas settings.
111+
108112
Examples
109113
--------
110114
>>> pd.options.context

pandas/_libs/lib.pyx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,9 +1122,23 @@ def is_integer(obj: object) -> bool:
11221122
"""
11231123
Return True if given object is integer.
11241124

1125+
This method checks whether the passed object is an integer type. It
1126+
returns `True` if the object is an integer, and `False` otherwise.
1127+
1128+
Parameters
1129+
----------
1130+
obj : object
1131+
The object to check for integer type.
1132+
11251133
Returns
11261134
-------
11271135
bool
1136+
`True` if the object is of integer type, otherwise `False`.
1137+
1138+
See Also
1139+
--------
1140+
api.types.is_float : Check if an object is of float type.
1141+
api.types.is_numeric_dtype : Check if an object is of numeric type.
11281142

11291143
Examples
11301144
--------

pandas/_libs/tslibs/offsets.pyx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3371,6 +3371,10 @@ cdef class SemiMonthBegin(SemiMonthOffset):
33713371
"""
33723372
Two DateOffset's per month repeating on the first day of the month & day_of_month.
33733373
3374+
This offset moves dates to the first day of the month and an additional specified
3375+
day (typically the 15th by default), useful in scenarios where bi-monthly processing
3376+
occurs on set days.
3377+
33743378
Attributes
33753379
----------
33763380
n : int, default 1
@@ -3380,6 +3384,13 @@ cdef class SemiMonthBegin(SemiMonthOffset):
33803384
day_of_month : int, {1, 3,...,27}, default 15
33813385
A specific integer for the day of the month.
33823386
3387+
See Also
3388+
--------
3389+
tseries.offsets.SemiMonthEnd : Two DateOffset's per month repeating on the last day
3390+
of the month & day_of_month.
3391+
tseries.offsets.MonthEnd : Offset to the last calendar day of the month.
3392+
tseries.offsets.MonthBegin : Offset to the first calendar day of the month.
3393+
33833394
Examples
33843395
--------
33853396
>>> ts = pd.Timestamp(2022, 1, 1)

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,10 +1864,12 @@ class Timedelta(_Timedelta):
18641864
18651865
Parameters
18661866
----------
1867-
value : Timedelta, timedelta, np.timedelta64, str, or int
1867+
value : Timedelta, timedelta, np.timedelta64, str, int or float
18681868
Input value.
18691869
unit : str, default 'ns'
1870-
Denote the unit of the input, if input is an integer.
1870+
If input is an integer, denote the unit of the input.
1871+
If input is a float, denote the unit of the integer parts.
1872+
The decimal parts with resolution lower than 1 nanosecond are ignored.
18711873
18721874
Possible values:
18731875

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10823,7 +10823,7 @@ def round(
1082310823
self, decimals: int | dict[IndexLabel, int] | Series = 0, *args, **kwargs
1082410824
) -> DataFrame:
1082510825
"""
10826-
Round a DataFrame to a variable number of decimal places.
10826+
Round numeric columns in a DataFrame to a variable number of decimal places.
1082710827
1082810828
Parameters
1082910829
----------

pandas/core/resample.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,10 @@ def sum(
10211021
"""
10221022
Compute sum of group values.
10231023
1024+
This method provides a simple way to compute the sum of values within each
1025+
resampled group, particularly useful for aggregating time-based data into
1026+
daily, monthly, or yearly sums.
1027+
10241028
Parameters
10251029
----------
10261030
numeric_only : bool, default False
@@ -1039,6 +1043,14 @@ def sum(
10391043
Series or DataFrame
10401044
Computed sum of values within each group.
10411045
1046+
See Also
1047+
--------
1048+
core.resample.Resampler.mean : Compute mean of groups, excluding missing values.
1049+
core.resample.Resampler.count : Compute count of group, excluding missing
1050+
values.
1051+
DataFrame.resample : Resample time-series data.
1052+
Series.sum : Return the sum of the values over the requested axis.
1053+
10421054
Examples
10431055
--------
10441056
>>> ser = pd.Series(

pandas/errors/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ class UnsupportedFunctionCall(ValueError):
7676
7777
For example, ``np.cumsum(groupby_object)``.
7878
79+
See Also
80+
--------
81+
DataFrame.groupby : Group DataFrame using a mapper or by a Series of columns.
82+
Series.groupby : Group Series using a mapper or by a Series of columns.
83+
core.groupby.GroupBy.cumsum : Compute cumulative sum for each group.
84+
7985
Examples
8086
--------
8187
>>> df = pd.DataFrame(
@@ -591,6 +597,14 @@ class CSSWarning(UserWarning):
591597
This can be due to the styling not having an equivalent value or because the
592598
styling isn't properly formatted.
593599
600+
See Also
601+
--------
602+
DataFrame.style : Returns a Styler object for applying CSS-like styles.
603+
io.formats.style.Styler : Helps style a DataFrame or Series according to the
604+
data with HTML and CSS.
605+
io.formats.style.Styler.to_excel : Export styled DataFrame to Excel.
606+
io.formats.style.Styler.to_html : Export styled DataFrame to HTML.
607+
594608
Examples
595609
--------
596610
>>> df = pd.DataFrame({"A": [1, 1, 1]})

pandas/io/json/_normalize.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ def json_normalize(
279279
"""
280280
Normalize semi-structured JSON data into a flat table.
281281
282+
This method is designed to transform semi-structured JSON data, such as nested
283+
dictionaries or lists, into a flat table. This is particularly useful when
284+
handling JSON-like data structures that contain deeply nested fields.
285+
282286
Parameters
283287
----------
284288
data : dict, list of dicts, or Series of dicts
@@ -310,8 +314,13 @@ def json_normalize(
310314
311315
Returns
312316
-------
313-
frame : DataFrame
314-
Normalize semi-structured JSON data into a flat table.
317+
DataFrame
318+
The normalized data, represented as a pandas DataFrame.
319+
320+
See Also
321+
--------
322+
DataFrame : Two-dimensional, size-mutable, potentially heterogeneous tabular data.
323+
Series : One-dimensional ndarray with axis labels (including time series).
315324
316325
Examples
317326
--------

0 commit comments

Comments
 (0)