Skip to content

Commit 3ceb00b

Browse files
resolve conflicts
2 parents f0429da + 54b1151 commit 3ceb00b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1106
-1062
lines changed

asv_bench/benchmarks/ctors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class SeriesConstructors:
6767
def setup(self, data_fmt, with_index, dtype):
6868
if data_fmt in (gen_of_str, gen_of_tuples) and with_index:
6969
raise NotImplementedError(
70-
"Series constructors do not support " "using generators with indexes"
70+
"Series constructors do not support using generators with indexes"
7171
)
7272
N = 10 ** 4
7373
if dtype == "float":

asv_bench/benchmarks/eval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def time_add(self, engine, threads):
2727

2828
def time_and(self, engine, threads):
2929
pd.eval(
30-
"(self.df > 0) & (self.df2 > 0) & " "(self.df3 > 0) & (self.df4 > 0)",
30+
"(self.df > 0) & (self.df2 > 0) & (self.df3 > 0) & (self.df4 > 0)",
3131
engine=engine,
3232
)
3333

asv_bench/benchmarks/io/hdf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ def time_write_store_table_dc(self):
8888

8989
def time_query_store_table_wide(self):
9090
self.store.select(
91-
"table_wide", where="index > self.start_wide and " "index < self.stop_wide"
91+
"table_wide", where="index > self.start_wide and index < self.stop_wide"
9292
)
9393

9494
def time_query_store_table(self):
95-
self.store.select("table", where="index > self.start and " "index < self.stop")
95+
self.store.select("table", where="index > self.start and index < self.stop")
9696

9797
def time_store_repr(self):
9898
repr(self.store)

doc/source/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,11 @@ def linkcode_resolve(domain, info):
628628
fn = os.path.relpath(fn, start=os.path.dirname(pandas.__file__))
629629

630630
if "+" in pandas.__version__:
631-
return "http://github.com/pandas-dev/pandas/blob/master/pandas/" "{}{}".format(
631+
return "http://github.com/pandas-dev/pandas/blob/master/pandas/{}{}".format(
632632
fn, linespec
633633
)
634634
else:
635-
return "http://github.com/pandas-dev/pandas/blob/" "v{}/pandas/{}{}".format(
635+
return "http://github.com/pandas-dev/pandas/blob/v{}/pandas/{}{}".format(
636636
pandas.__version__, fn, linespec
637637
)
638638

doc/source/whatsnew/v1.0.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Timezones
256256
Numeric
257257
^^^^^^^
258258
- Bug in :meth:`DataFrame.quantile` with zero-column :class:`DataFrame` incorrectly raising (:issue:`23925`)
259-
- :class:`DataFrame` inequality comparisons with object-dtype and ``complex`` entries failing to raise ``TypeError`` like their :class:`Series` counterparts (:issue:`28079`)
259+
- :class:`DataFrame` flex inequality comparisons methods (:meth:`DataFrame.lt`, :meth:`DataFrame.le`, :meth:`DataFrame.gt`, :meth: `DataFrame.ge`) with object-dtype and ``complex`` entries failing to raise ``TypeError`` like their :class:`Series` counterparts (:issue:`28079`)
260260
- Bug in :class:`DataFrame` logical operations (`&`, `|`, `^`) not matching :class:`Series` behavior by filling NA values (:issue:`28741`)
261261
-
262262

pandas/_libs/reduction.pyx

+3-3
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ cdef class Reducer:
170170
PyArray_SETITEM(result, PyArray_ITER_DATA(it), res)
171171
chunk.data = chunk.data + self.increment
172172
PyArray_ITER_NEXT(it)
173-
except Exception, e:
174-
if hasattr(e, 'args'):
175-
e.args = e.args + (i,)
173+
except Exception as err:
174+
if hasattr(err, 'args'):
175+
err.args = err.args + (i,)
176176
raise
177177
finally:
178178
# so we don't free the wrong memory

pandas/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
249249
# tag
250250
full_tag = mo.group(1)
251251
if not full_tag.startswith(tag_prefix):
252-
fmt = "tag '{full_tag}' doesn't start with prefix " "'{tag_prefix}'"
252+
fmt = "tag '{full_tag}' doesn't start with prefix '{tag_prefix}'"
253253
msg = fmt.format(full_tag=full_tag, tag_prefix=tag_prefix)
254254
if verbose:
255255
print(msg)

pandas/core/apply.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,15 @@ def apply_series_generator(self):
343343
for i, v in enumerate(series_gen):
344344
results[i] = self.f(v)
345345
keys.append(v.name)
346-
except Exception as e:
347-
if hasattr(e, "args"):
346+
except Exception as err:
347+
if hasattr(err, "args"):
348348

349349
# make sure i is defined
350350
if i is not None:
351351
k = res_index[i]
352-
e.args = e.args + ("occurred at index %s" % pprint_thing(k),)
352+
err.args = err.args + (
353+
"occurred at index %s" % pprint_thing(k),
354+
)
353355
raise
354356

355357
self.results = results

pandas/core/arrays/categorical.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ def from_codes(cls, codes, categories=None, ordered=None, dtype=None):
639639
640640
Parameters
641641
----------
642-
codes : array-like, integers
642+
codes : array-like of int
643643
An integer array, where each integer points to a category in
644644
categories or dtype.categories, or else is -1 for NaN.
645645
categories : index-like, optional
@@ -650,7 +650,7 @@ def from_codes(cls, codes, categories=None, ordered=None, dtype=None):
650650
Whether or not this categorical is treated as an ordered
651651
categorical. If not given here or in `dtype`, the resulting
652652
categorical will be unordered.
653-
dtype : CategoricalDtype or the string "category", optional
653+
dtype : CategoricalDtype or "category", optional
654654
If :class:`CategoricalDtype`, cannot be used together with
655655
`categories` or `ordered`.
656656

pandas/core/arrays/datetimelike.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ def value_counts(self, dropna=False):
669669
670670
Parameters
671671
----------
672-
dropna : boolean, default True
672+
dropna : bool, default True
673673
Don't include counts of NaT values.
674674
675675
Returns
@@ -727,7 +727,7 @@ def _maybe_mask_results(self, result, fill_value=iNaT, convert=None):
727727
----------
728728
result : a ndarray
729729
fill_value : object, default iNaT
730-
convert : string/dtype or None
730+
convert : str, dtype or None
731731
732732
Returns
733733
-------
@@ -1167,7 +1167,7 @@ def _time_shift(self, periods, freq=None):
11671167
----------
11681168
periods : int
11691169
Number of periods to shift by.
1170-
freq : pandas.DateOffset, pandas.Timedelta, or string
1170+
freq : pandas.DateOffset, pandas.Timedelta, or str
11711171
Frequency increment to shift by.
11721172
"""
11731173
if freq is not None and freq != self.freq:

pandas/core/arrays/integer.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def integer_array(values, dtype=None, copy=False):
9595
values : 1D list-like
9696
dtype : dtype, optional
9797
dtype to coerce
98-
copy : boolean, default False
98+
copy : bool, default False
9999
100100
Returns
101101
-------
@@ -140,8 +140,8 @@ def coerce_to_array(values, dtype, mask=None, copy=False):
140140
----------
141141
values : 1D list-like
142142
dtype : integer dtype
143-
mask : boolean 1D array, optional
144-
copy : boolean, default False
143+
mask : bool 1D array, optional
144+
copy : bool, default False
145145
if True, copy the input
146146
147147
Returns
@@ -542,7 +542,7 @@ def value_counts(self, dropna=True):
542542
543543
Parameters
544544
----------
545-
dropna : boolean, default True
545+
dropna : bool, default True
546546
Don't include counts of NaN.
547547
548548
Returns

pandas/core/arrays/period.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ def to_timestamp(self, freq=None, how="start"):
446446
447447
Parameters
448448
----------
449-
freq : string or DateOffset, optional
449+
freq : str or DateOffset, optional
450450
Target frequency. The default is 'D' for week or longer,
451451
'S' otherwise
452452
how : {'s', 'e', 'start', 'end'}
@@ -517,7 +517,7 @@ def _time_shift(self, periods, freq=None):
517517
----------
518518
periods : int
519519
Number of periods to shift by.
520-
freq : pandas.DateOffset, pandas.Timedelta, or string
520+
freq : pandas.DateOffset, pandas.Timedelta, or str
521521
Frequency increment to shift by.
522522
"""
523523
if freq is not None:

pandas/core/dtypes/cast.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ def maybe_infer_to_datetimelike(value, convert_dates=False):
10071007
Parameters
10081008
----------
10091009
value : np.array / Series / Index / list-like
1010-
convert_dates : boolean, default False
1010+
convert_dates : bool, default False
10111011
if True try really hard to convert dates (such as datetime.date), other
10121012
leave inferred dtype 'date' alone
10131013
@@ -1446,7 +1446,7 @@ def maybe_cast_to_integer_array(arr, dtype, copy=False):
14461446
The array to cast.
14471447
dtype : str, np.dtype
14481448
The integer dtype to cast the array to.
1449-
copy: boolean, default False
1449+
copy: bool, default False
14501450
Whether to make a copy of the array before returning.
14511451
14521452
Returns

pandas/core/dtypes/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def ensure_int_or_float(arr: ArrayLike, copy: bool = False) -> np.array:
152152
----------
153153
arr : array-like
154154
The array whose data type we want to enforce.
155-
copy: boolean
155+
copy: bool
156156
Whether to copy the original array or reuse
157157
it in place, if possible.
158158

pandas/core/dtypes/concat.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,10 @@ def union_categoricals(to_union, sort_categories=False, ignore_order=False):
192192
----------
193193
to_union : list-like of Categorical, CategoricalIndex,
194194
or Series with dtype='category'
195-
sort_categories : boolean, default False
195+
sort_categories : bool, default False
196196
If true, resulting categories will be lexsorted, otherwise
197197
they will be ordered as they appear in the data.
198-
ignore_order : boolean, default False
198+
ignore_order : bool, default False
199199
If true, the ordered attribute of the Categoricals will be ignored.
200200
Results in an unordered categorical.
201201

pandas/core/dtypes/dtypes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def find(
8585
"""
8686
Parameters
8787
----------
88-
dtype : Type[ExtensionDtype] or string
88+
dtype : Type[ExtensionDtype] or str
8989
9090
Returns
9191
-------

pandas/core/dtypes/missing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ def na_value_for_dtype(dtype, compat=True):
521521
Parameters
522522
----------
523523
dtype : string / dtype
524-
compat : boolean, default True
524+
compat : bool, default True
525525
526526
Returns
527527
-------

pandas/core/generic.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -4561,10 +4561,7 @@ def reindex(self, *args, **kwargs):
45614561

45624562
# check if we are a multi reindex
45634563
if self._needs_reindex_multi(axes, method, level):
4564-
try:
4565-
return self._reindex_multi(axes, copy, fill_value)
4566-
except Exception:
4567-
pass
4564+
return self._reindex_multi(axes, copy, fill_value)
45684565

45694566
# perform the reindex on the axes
45704567
return self._reindex_axes(
@@ -9074,7 +9071,6 @@ def _where(
90749071

90759072
# try to not change dtype at first (if try_quick)
90769073
if try_quick:
9077-
90789074
new_other = com.values_from_object(self)
90799075
new_other = new_other.copy()
90809076
new_other[icond] = other

pandas/core/series.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -2076,12 +2076,12 @@ def idxmin(self, axis=0, skipna=True, *args, **kwargs):
20762076
20772077
Parameters
20782078
----------
2079-
skipna : bool, default True
2080-
Exclude NA/null values. If the entire Series is NA, the result
2081-
will be NA.
20822079
axis : int, default 0
20832080
For compatibility with DataFrame.idxmin. Redundant for application
20842081
on Series.
2082+
skipna : bool, default True
2083+
Exclude NA/null values. If the entire Series is NA, the result
2084+
will be NA.
20852085
*args, **kwargs
20862086
Additional keywords have no effect but might be accepted
20872087
for compatibility with NumPy.
@@ -2146,12 +2146,12 @@ def idxmax(self, axis=0, skipna=True, *args, **kwargs):
21462146
21472147
Parameters
21482148
----------
2149-
skipna : bool, default True
2150-
Exclude NA/null values. If the entire Series is NA, the result
2151-
will be NA.
21522149
axis : int, default 0
21532150
For compatibility with DataFrame.idxmax. Redundant for application
21542151
on Series.
2152+
skipna : bool, default True
2153+
Exclude NA/null values. If the entire Series is NA, the result
2154+
will be NA.
21552155
*args, **kwargs
21562156
Additional keywords have no effect but might be accepted
21572157
for compatibility with NumPy.

pandas/io/sas/sas7bdat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ def _read_next_page(self):
672672
return True
673673
elif len(self._cached_page) != self._page_length:
674674
self.close()
675-
msg = "failed to read complete page from file " "(read {:d} of {:d} bytes)"
675+
msg = "failed to read complete page from file (read {:d} of {:d} bytes)"
676676
raise ValueError(msg.format(len(self._cached_page), self._page_length))
677677

678678
self._read_page_header()

pandas/plotting/_core.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ def _get_call_args(backend_name, data, args, kwargs):
685685
else:
686686
raise TypeError(
687687
(
688-
"Called plot accessor for type {}, expected " "Series or DataFrame"
688+
"Called plot accessor for type {}, expected Series or DataFrame"
689689
).format(type(data).__name__)
690690
)
691691

@@ -740,7 +740,7 @@ def __call__(self, *args, **kwargs):
740740
return plot_backend.plot(data, x=x, y=y, kind=kind, **kwargs)
741741
else:
742742
raise ValueError(
743-
("plot kind {} can only be used for " "data frames").format(kind)
743+
("plot kind {} can only be used for data frames").format(kind)
744744
)
745745
elif kind in self._series_kinds:
746746
if isinstance(data, ABCDataFrame):

pandas/plotting/_matplotlib/boxplot.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,7 @@ def plot_group(keys, values, ax):
331331
if return_type is None:
332332
return_type = "axes"
333333
if layout is not None:
334-
raise ValueError(
335-
"The 'layout' keyword is not supported when " "'by' is None"
336-
)
334+
raise ValueError("The 'layout' keyword is not supported when 'by' is None")
337335

338336
if ax is None:
339337
rc = {"figure.figsize": figsize} if figsize is not None else {}

pandas/plotting/_matplotlib/core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def _validate_color_args(self):
230230
"color" in self.kwds or "colors" in self.kwds
231231
) and self.colormap is not None:
232232
warnings.warn(
233-
"'color' and 'colormap' cannot be used " "simultaneously. Using 'color'"
233+
"'color' and 'colormap' cannot be used simultaneously. Using 'color'"
234234
)
235235

236236
if "color" in self.kwds and self.style is not None:

pandas/plotting/_matplotlib/hist.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def _grouped_plot(
184184
if figsize == "default":
185185
# allowed to specify mpl default with 'default'
186186
warnings.warn(
187-
"figsize='default' is deprecated. Specify figure " "size by tuple instead",
187+
"figsize='default' is deprecated. Specify figure size by tuple instead",
188188
FutureWarning,
189189
stacklevel=5,
190190
)
@@ -298,9 +298,7 @@ def hist_series(
298298

299299
if by is None:
300300
if kwds.get("layout", None) is not None:
301-
raise ValueError(
302-
"The 'layout' keyword is not supported when " "'by' is None"
303-
)
301+
raise ValueError("The 'layout' keyword is not supported when 'by' is None")
304302
# hack until the plotting interface is a bit more unified
305303
fig = kwds.pop(
306304
"figure", plt.gcf() if plt.get_fignums() else plt.figure(figsize=figsize)
@@ -394,7 +392,7 @@ def hist_frame(
394392
naxes = len(data.columns)
395393

396394
if naxes == 0:
397-
raise ValueError("hist method requires numerical columns, " "nothing to plot.")
395+
raise ValueError("hist method requires numerical columns, nothing to plot.")
398396

399397
fig, axes = _subplots(
400398
naxes=naxes,

pandas/plotting/_matplotlib/style.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def _get_standard_colors(
2525
elif color is not None:
2626
if colormap is not None:
2727
warnings.warn(
28-
"'color' and 'colormap' cannot be used " "simultaneously. Using 'color'"
28+
"'color' and 'colormap' cannot be used simultaneously. Using 'color'"
2929
)
3030
colors = list(color) if is_list_like(color) else color
3131
else:

pandas/plotting/_matplotlib/tools.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ def _subplots(
188188
ax = _flatten(ax)
189189
if layout is not None:
190190
warnings.warn(
191-
"When passing multiple axes, layout keyword is " "ignored",
192-
UserWarning,
191+
"When passing multiple axes, layout keyword is ignored", UserWarning
193192
)
194193
if sharex or sharey:
195194
warnings.warn(

0 commit comments

Comments
 (0)