Skip to content

Commit fd103dc

Browse files
committed
Merge remote-tracking branch 'upstream/master' into integer-quantile
2 parents 4a8ed58 + d7a100c commit fd103dc

File tree

15 files changed

+177
-174
lines changed

15 files changed

+177
-174
lines changed

doc/source/getting_started/intro_tutorials/01_table_oriented.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ documentation.
2626
</li>
2727
</ul>
2828

29-
Pandas data table representation
29+
pandas data table representation
3030
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3131

3232
.. image:: ../../_static/schemas/01_table_dataframe.svg

doc/source/getting_started/tutorials.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
{{ header }}
44

55
*******************
6-
Community Tutorials
6+
Community tutorials
77
*******************
88

99
This is a guide to many pandas tutorials by the community, geared mainly for new users.
1010

11-
pandas Cookbook by Julia Evans
11+
pandas cookbook by Julia Evans
1212
------------------------------
1313

1414
The goal of this 2015 cookbook (by `Julia Evans <https://jvns.ca>`_) is to
@@ -18,7 +18,7 @@ entails.
1818
For the table of contents, see the `pandas-cookbook GitHub
1919
repository <https://github.com/jvns/pandas-cookbook>`_.
2020

21-
Learn Pandas by Hernan Rojas
21+
Learn pandas by Hernan Rojas
2222
----------------------------
2323

2424
A set of lesson for new pandas users: https://bitbucket.org/hrojas/learn-pandas

doc/source/reference/arrays.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.. _api.arrays:
44

55
=============
6-
Pandas arrays
6+
pandas arrays
77
=============
88

99
.. currentmodule:: pandas

doc/source/reference/window.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Exponentially-weighted moving window functions
7575
EWM.corr
7676
EWM.cov
7777

78-
Window Indexer
78+
Window indexer
7979
--------------
8080
.. currentmodule:: pandas
8181

doc/source/user_guide/boolean.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ If you would prefer to keep the ``NA`` values you can manually fill them with ``
3939
4040
.. _boolean.kleene:
4141

42-
Kleene Logical Operations
42+
Kleene logical operations
4343
-------------------------
4444

4545
:class:`arrays.BooleanArray` implements `Kleene Logic`_ (sometimes called three-value logic) for

doc/source/whatsnew/v1.1.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ I/O
405405
- Bug in :meth:`read_csv` was causing a segfault when there were blank lines between the header and data rows (:issue:`28071`)
406406
- Bug in :meth:`read_csv` was raising a misleading exception on a permissions issue (:issue:`23784`)
407407
- Bug in :meth:`read_csv` was raising an ``IndexError`` when header=None and 2 extra data columns
408-
408+
- Bug in :meth:`DataFrame.to_sql` where an ``AttributeError`` was raised when saving an out of bounds date (:issue:`26761`)
409409

410410
Plotting
411411
^^^^^^^^

pandas/_libs/parsers.pyx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ cdef class TextReader:
267267

268268
cdef:
269269
parser_t *parser
270-
object file_handle, na_fvalues
270+
object na_fvalues
271271
object true_values, false_values
272272
object handle
273273
bint na_filter, keep_default_na, verbose, has_usecols, has_mi_columns
@@ -601,7 +601,6 @@ cdef class TextReader:
601601

602602
cdef _setup_parser_source(self, source):
603603
cdef:
604-
int status
605604
void *ptr
606605

607606
self.parser.cb_io = NULL
@@ -687,7 +686,6 @@ cdef class TextReader:
687686
Py_ssize_t i, start, field_count, passed_count, unnamed_count
688687
char *word
689688
object name, old_name
690-
int status
691689
uint64_t hr, data_line = 0
692690
char *errors = "strict"
693691
StringPath path = _string_path(self.c_encoding)
@@ -837,9 +835,6 @@ cdef class TextReader:
837835
"""
838836
rows=None --> read all rows
839837
"""
840-
cdef:
841-
int status
842-
843838
if self.low_memory:
844839
# Conserve intermediate space
845840
columns = self._read_low_memory(rows)
@@ -888,7 +883,9 @@ cdef class TextReader:
888883
return _concatenate_chunks(chunks)
889884

890885
cdef _tokenize_rows(self, size_t nrows):
891-
cdef int status
886+
cdef:
887+
int status
888+
892889
with nogil:
893890
status = tokenize_nrows(self.parser, nrows)
894891

@@ -1331,7 +1328,8 @@ cdef:
13311328

13321329

13331330
def _ensure_encoded(list lst):
1334-
cdef list result = []
1331+
cdef:
1332+
list result = []
13351333
for x in lst:
13361334
if isinstance(x, str):
13371335
x = PyUnicode_AsUTF8String(x)
@@ -1458,7 +1456,7 @@ cdef _string_box_decode(parser_t *parser, int64_t col,
14581456
bint na_filter, kh_str_starts_t *na_hashset,
14591457
char *encoding):
14601458
cdef:
1461-
int error, na_count = 0
1459+
int na_count = 0
14621460
Py_ssize_t i, size, lines
14631461
coliter_t it
14641462
const char *word = NULL
@@ -1517,7 +1515,7 @@ cdef _categorical_convert(parser_t *parser, int64_t col,
15171515
char *encoding):
15181516
"Convert column data into codes, categories"
15191517
cdef:
1520-
int error, na_count = 0
1518+
int na_count = 0
15211519
Py_ssize_t i, size, lines
15221520
coliter_t it
15231521
const char *word = NULL
@@ -1581,7 +1579,6 @@ cdef _categorical_convert(parser_t *parser, int64_t col,
15811579
cdef _to_fw_string(parser_t *parser, int64_t col, int64_t line_start,
15821580
int64_t line_end, int64_t width):
15831581
cdef:
1584-
const char *word = NULL
15851582
char *data
15861583
ndarray result
15871584

@@ -1767,7 +1764,6 @@ cdef inline int _try_uint64_nogil(parser_t *parser, int64_t col,
17671764
Py_ssize_t i, lines = line_end - line_start
17681765
coliter_t it
17691766
const char *word = NULL
1770-
khiter_t k
17711767

17721768
coliter_setup(&it, parser, col, line_start)
17731769

@@ -1870,9 +1866,7 @@ cdef _try_bool_flex(parser_t *parser, int64_t col,
18701866
Py_ssize_t lines
18711867
uint8_t *data
18721868
ndarray result
1873-
18741869
uint8_t NA = na_values[np.bool_]
1875-
khiter_t k
18761870

18771871
lines = line_end - line_start
18781872
result = np.empty(lines, dtype=np.uint8)

pandas/core/groupby/generic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
from pandas._libs import Timestamp, lib
3333
from pandas._typing import FrameOrSeries
34-
from pandas.util._decorators import Appender, Substitution
34+
from pandas.util._decorators import Appender, Substitution, doc
3535

3636
from pandas.core.dtypes.cast import (
3737
maybe_cast_result,
@@ -633,7 +633,7 @@ def nunique(self, dropna: bool = True) -> Series:
633633
result = Series(res, index=ri, name=self._selection_name)
634634
return self._reindex_output(result, fill_value=0)
635635

636-
@Appender(Series.describe.__doc__)
636+
@doc(Series.describe)
637637
def describe(self, **kwargs):
638638
result = self.apply(lambda x: x.describe(**kwargs))
639639
if self.axis == 1:

pandas/core/groupby/groupby.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class providing the base-class of operations.
3737
from pandas.compat import set_function_name
3838
from pandas.compat.numpy import function as nv
3939
from pandas.errors import AbstractMethodError
40-
from pandas.util._decorators import Appender, Substitution, cache_readonly
40+
from pandas.util._decorators import Appender, Substitution, cache_readonly, doc
4141

4242
from pandas.core.dtypes.cast import maybe_cast_result
4343
from pandas.core.dtypes.common import (
@@ -1421,7 +1421,7 @@ def ohlc(self) -> DataFrame:
14211421
"""
14221422
return self._apply_to_column_groupbys(lambda x: x._cython_agg_general("ohlc"))
14231423

1424-
@Appender(DataFrame.describe.__doc__)
1424+
@doc(DataFrame.describe)
14251425
def describe(self, **kwargs):
14261426
with _group_selection_context(self):
14271427
result = self.apply(lambda x: x.describe(**kwargs))
@@ -2514,7 +2514,7 @@ def _reindex_output(
25142514
GroupBy._add_numeric_operations()
25152515

25162516

2517-
@Appender(GroupBy.__doc__)
2517+
@doc(GroupBy)
25182518
def get_groupby(
25192519
obj: NDFrame,
25202520
by: Optional[_KeysArgType] = None,

pandas/core/indexes/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from pandas._typing import Label
1616
from pandas.compat import set_function_name
1717
from pandas.compat.numpy import function as nv
18-
from pandas.util._decorators import Appender, Substitution, cache_readonly
18+
from pandas.util._decorators import Appender, Substitution, cache_readonly, doc
1919

2020
from pandas.core.dtypes import concat as _concat
2121
from pandas.core.dtypes.cast import (
@@ -3835,7 +3835,7 @@ def values(self) -> np.ndarray:
38353835
return self._data.view(np.ndarray)
38363836

38373837
@cache_readonly
3838-
@Appender(IndexOpsMixin.array.__doc__) # type: ignore
3838+
@doc(IndexOpsMixin.array) # type: ignore
38393839
def array(self) -> ExtensionArray:
38403840
array = self._data
38413841
if isinstance(array, np.ndarray):
@@ -3876,7 +3876,7 @@ def _get_engine_target(self) -> np.ndarray:
38763876
"""
38773877
return self._values
38783878

3879-
@Appender(IndexOpsMixin.memory_usage.__doc__)
3879+
@doc(IndexOpsMixin.memory_usage)
38803880
def memory_usage(self, deep: bool = False) -> int:
38813881
result = super().memory_usage(deep=deep)
38823882

pandas/core/indexes/category.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pandas._libs.hashtable import duplicated_int64
1010
from pandas._libs.lib import no_default
1111
from pandas._typing import Label
12-
from pandas.util._decorators import Appender, cache_readonly
12+
from pandas.util._decorators import Appender, cache_readonly, doc
1313

1414
from pandas.core.dtypes.common import (
1515
ensure_platform_int,
@@ -241,7 +241,7 @@ def _simple_new(cls, values: Categorical, name: Label = None):
241241

242242
# --------------------------------------------------------------------
243243

244-
@Appender(Index._shallow_copy.__doc__)
244+
@doc(Index._shallow_copy)
245245
def _shallow_copy(self, values=None, name: Label = no_default):
246246
name = self.name if name is no_default else name
247247

@@ -354,7 +354,7 @@ def _has_complex_internals(self) -> bool:
354354
# used to avoid libreduction code paths, which raise or require conversion
355355
return True
356356

357-
@Appender(Index.__contains__.__doc__)
357+
@doc(Index.__contains__)
358358
def __contains__(self, key: Any) -> bool:
359359
# if key is a NaN, check if any NaN is in self.
360360
if is_scalar(key) and isna(key):
@@ -363,7 +363,7 @@ def __contains__(self, key: Any) -> bool:
363363
hash(key)
364364
return contains(self, key, container=self._engine)
365365

366-
@Appender(Index.astype.__doc__)
366+
@doc(Index.astype)
367367
def astype(self, dtype, copy=True):
368368
if is_interval_dtype(dtype):
369369
from pandas import IntervalIndex
@@ -382,7 +382,7 @@ def _isnan(self):
382382
""" return if each value is nan"""
383383
return self._data.codes == -1
384384

385-
@Appender(Index.fillna.__doc__)
385+
@doc(Index.fillna)
386386
def fillna(self, value, downcast=None):
387387
self._assert_can_do_op(value)
388388
return CategoricalIndex(self._data.fillna(value), name=self.name)
@@ -395,7 +395,7 @@ def _engine(self):
395395
codes = self.codes
396396
return self._engine_type(lambda: codes, len(self))
397397

398-
@Appender(Index.unique.__doc__)
398+
@doc(Index.unique)
399399
def unique(self, level=None):
400400
if level is not None:
401401
self._validate_index_level(level)
@@ -404,7 +404,7 @@ def unique(self, level=None):
404404
# of result, not self.
405405
return type(self)._simple_new(result, name=self.name)
406406

407-
@Appender(Index.duplicated.__doc__)
407+
@doc(Index.duplicated)
408408
def duplicated(self, keep="first"):
409409
codes = self.codes.astype("i8")
410410
return duplicated_int64(codes, keep)
@@ -418,7 +418,7 @@ def _maybe_cast_indexer(self, key):
418418
code = self.codes.dtype.type(code)
419419
return code
420420

421-
@Appender(Index.where.__doc__)
421+
@doc(Index.where)
422422
def where(self, cond, other=None):
423423
# TODO: Investigate an alternative implementation with
424424
# 1. copy the underlying Categorical
@@ -569,7 +569,7 @@ def get_indexer_non_unique(self, target):
569569
indexer, missing = self._engine.get_indexer_non_unique(codes)
570570
return ensure_platform_int(indexer), missing
571571

572-
@Appender(Index._convert_list_indexer.__doc__)
572+
@doc(Index._convert_list_indexer)
573573
def _convert_list_indexer(self, keyarr):
574574
# Return our indexer or raise if all of the values are not included in
575575
# the categories
@@ -586,7 +586,7 @@ def _convert_list_indexer(self, keyarr):
586586

587587
return self.get_indexer(keyarr)
588588

589-
@Appender(Index._convert_arr_indexer.__doc__)
589+
@doc(Index._convert_arr_indexer)
590590
def _convert_arr_indexer(self, keyarr):
591591
keyarr = com.asarray_tuplesafe(keyarr)
592592

@@ -595,7 +595,7 @@ def _convert_arr_indexer(self, keyarr):
595595

596596
return self._shallow_copy(keyarr)
597597

598-
@Appender(Index._convert_index_indexer.__doc__)
598+
@doc(Index._convert_index_indexer)
599599
def _convert_index_indexer(self, keyarr):
600600
return self._shallow_copy(keyarr)
601601

@@ -608,7 +608,7 @@ def take_nd(self, *args, **kwargs):
608608
)
609609
return self.take(*args, **kwargs)
610610

611-
@Appender(Index._maybe_cast_slice_bound.__doc__)
611+
@doc(Index._maybe_cast_slice_bound)
612612
def _maybe_cast_slice_bound(self, label, side, kind):
613613
if kind == "loc":
614614
return label

pandas/io/sql.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,8 @@ def _sqlalchemy_type(self, col):
978978
return TIMESTAMP(timezone=True)
979979
except AttributeError:
980980
# The column is actually a DatetimeIndex
981-
if col.tz is not None:
981+
# GH 26761 or an Index with date-like data e.g. 9999-01-01
982+
if getattr(col, "tz", None) is not None:
982983
return TIMESTAMP(timezone=True)
983984
return DateTime
984985
if col_type == "timedelta64":

pandas/plotting/_misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def parallel_coordinates(
359359
--------
360360
>>> from matplotlib import pyplot as plt
361361
>>> df = pd.read_csv('https://raw.github.com/pandas-dev/pandas/master'
362-
'/pandas/tests/data/csv/iris.csv')
362+
'/pandas/tests/data/iris.csv')
363363
>>> pd.plotting.parallel_coordinates(
364364
df, 'Name',
365365
color=('#556270', '#4ECDC4', '#C7F464'))

0 commit comments

Comments
 (0)