Skip to content

Commit df14a3e

Browse files
authored
Merge pull request #140 from pandas-dev/master
Sync Fork from Upstream Repo
2 parents 0aa5e61 + 8f11655 commit df14a3e

File tree

9 files changed

+30
-17
lines changed

9 files changed

+30
-17
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ jobs:
162162
pytest pandas/tests/groupby/
163163
pytest pandas/tests/resample/
164164
pytest pandas/tests/reshape/merge
165-
166-
pytest pandas/tests/series/methods
167-
pytest pandas/tests/series/test_*
165+
pytest pandas/tests/series/
168166
169167
# indexing subset (temporary since other tests don't pass yet)
170168
pytest pandas/tests/indexing/multiindex/test_setitem.py::TestMultiIndexSetItem::test_astype_assignment_with_dups

doc/source/_static/css/pandas.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
:root {
44
/* Use softer blue from bootstrap's default info color */
5-
--color-info: 23, 162, 184;
5+
--pst-color-info: 23, 162, 184;
66
}
77

88
/* Getting started index page */

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,5 @@ dependencies:
113113
- tabulate>=0.8.3 # DataFrame.to_markdown
114114
- natsort # DataFrame.sort_values
115115
- pip:
116-
- git+https://github.com/pandas-dev/pydata-sphinx-theme.git@2488b7defbd3d753dd5fcfc890fc4a7e79d25103
116+
- git+https://github.com/pydata/pydata-sphinx-theme.git@master
117117
- numpydoc < 1.2 # 2021-02-09 1.2dev breaking CI

pandas/core/frame.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3784,7 +3784,7 @@ def _box_col_values(self, values, loc: int) -> Series:
37843784
# Unsorted
37853785

37863786
def query(self, expr: str, inplace: bool = False, **kwargs):
3787-
"""
3787+
r"""
37883788
Query the columns of a DataFrame with a boolean expression.
37893789
37903790
Parameters
@@ -3799,8 +3799,8 @@ def query(self, expr: str, inplace: bool = False, **kwargs):
37993799
You can refer to column names that are not valid Python variable names
38003800
by surrounding them in backticks. Thus, column names containing spaces
38013801
or punctuations (besides underscores) or starting with digits must be
3802-
surrounded by backticks. (For example, a column named "Area (cm^2) would
3803-
be referenced as `Area (cm^2)`). Column names which are Python keywords
3802+
surrounded by backticks. (For example, a column named "Area (cm^2)" would
3803+
be referenced as \`Area (cm^2)\`). Column names which are Python keywords
38043804
(like "list", "for", "import", etc) cannot be used.
38053805
38063806
For example, if one of your columns is called ``a a`` and you want

pandas/core/internals/array_manager.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def get_dtypes(self):
202202
def __repr__(self) -> str:
203203
output = type(self).__name__
204204
output += f"\nIndex: {self._axes[0]}"
205-
if self.ndim == 1:
205+
if self.ndim == 2:
206206
output += f"\nColumns: {self._axes[1]}"
207207
output += f"\n{len(self.arrays)} arrays:"
208208
for arr in self.arrays:
@@ -1138,7 +1138,13 @@ def __init__(
11381138
def _verify_integrity(self) -> None:
11391139
(n_rows,) = self.shape
11401140
assert len(self.arrays) == 1
1141-
assert len(self.arrays[0]) == n_rows
1141+
arr = self.arrays[0]
1142+
assert len(arr) == n_rows
1143+
if not arr.ndim == 1:
1144+
raise ValueError(
1145+
"Passed array should be 1-dimensional, got array with "
1146+
f"{arr.ndim} dimensions instead."
1147+
)
11421148

11431149
@staticmethod
11441150
def _normalize_axis(axis):

pandas/tests/series/indexing/test_getitem.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,12 @@ def test_getitem_partial_str_slice_high_reso_with_timedeltaindex(self):
234234
result = ser["1 days, 10:11:12.001001"]
235235
assert result == ser.iloc[1001]
236236

237-
def test_getitem_slice_2d(self, datetime_series):
237+
def test_getitem_slice_2d(self, datetime_series, using_array_manager):
238238
# GH#30588 multi-dimensional indexing deprecated
239239

240-
with tm.assert_produces_warning(FutureWarning):
240+
with tm.assert_produces_warning(
241+
FutureWarning, check_stacklevel=not using_array_manager
242+
):
241243
# GH#30867 Don't want to support this long-term, but
242244
# for now ensure that the warning from Index
243245
# doesn't comes through via Series.__getitem__.
@@ -518,9 +520,11 @@ def test_getitem_generator(string_series):
518520
Series(date_range("2012-01-01", periods=2, tz="CET")),
519521
],
520522
)
521-
def test_getitem_ndim_deprecated(series):
523+
def test_getitem_ndim_deprecated(series, using_array_manager):
522524
with tm.assert_produces_warning(
523-
FutureWarning, match="Support for multi-dimensional indexing"
525+
FutureWarning,
526+
match="Support for multi-dimensional indexing",
527+
check_stacklevel=not using_array_manager,
524528
):
525529
result = series[:, None]
526530

pandas/tests/series/indexing/test_setitem.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ def test_dt64tz_setitem_does_not_mutate_dti(self):
306306
ser = Series(dti)
307307
assert ser._values is not dti
308308
assert ser._values._data.base is not dti._data._data.base
309-
assert ser._mgr.blocks[0].values is not dti
310-
assert ser._mgr.blocks[0].values._data.base is not dti._data._data.base
309+
assert ser._mgr.arrays[0] is not dti
310+
assert ser._mgr.arrays[0]._data.base is not dti._data._data.base
311311

312312
ser[::3] = NaT
313313
assert ser[0] is NaT

pandas/tests/series/indexing/test_where.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import numpy as np
22
import pytest
33

4+
import pandas.util._test_decorators as td
5+
46
from pandas.core.dtypes.common import is_integer
57

68
import pandas as pd
@@ -471,6 +473,9 @@ def test_where_categorical(klass):
471473
tm.assert_equal(exp, res)
472474

473475

476+
# TODO(ArrayManager) DataFrame.values not yet correctly returning datetime array
477+
# for categorical with datetime categories
478+
@td.skip_array_manager_not_yet_implemented
474479
def test_where_datetimelike_categorical(tz_naive_fixture):
475480
# GH#37682
476481
tz = tz_naive_fixture

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ cftime
7676
pyreadstat
7777
tabulate>=0.8.3
7878
natsort
79-
git+https://github.com/pandas-dev/pydata-sphinx-theme.git@2488b7defbd3d753dd5fcfc890fc4a7e79d25103
79+
git+https://github.com/pydata/pydata-sphinx-theme.git@master
8080
numpydoc < 1.2

0 commit comments

Comments
 (0)