Skip to content

Sync Fork from Upstream Repo #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v1.1.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Numeric
Conversion
^^^^^^^^^^
- Bug in :class:`Series` construction from NumPy array with big-endian ``datetime64`` dtype (:issue:`29684`)
- Bug in :class:`Timedelta` construction with large nanoseconds keyword value (:issue:`34202`)
- Bug in :class:`Timedelta` construction with large nanoseconds keyword value (:issue:`32402`)
-

Strings
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def nunique(self, dropna: bool = True) -> Series:
"""
ids, _, _ = self.grouper.group_info

val = self.obj._internal_get_values()
val = self.obj._values

codes, _ = algorithms.factorize(val, sort=False)
sorter = np.lexsort((codes, ids))
Expand Down Expand Up @@ -657,7 +657,7 @@ def value_counts(
)

ids, _, _ = self.grouper.group_info
val = self.obj._internal_get_values()
val = self.obj._values

# groupby removes null keys from groupings
mask = ids != -1
Expand Down Expand Up @@ -774,7 +774,7 @@ def count(self) -> Series:
Count of values within each group.
"""
ids, _, ngroups = self.grouper.group_info
val = self.obj._internal_get_values()
val = self.obj._values

mask = (ids != -1) & ~isna(val)
ids = ensure_platform_int(ids)
Expand Down
12 changes: 10 additions & 2 deletions pandas/plotting/_matplotlib/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from pandas.core.dtypes.common import is_list_like
from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCSeries

from pandas.plotting._matplotlib import compat


def format_date_labels(ax, rot):
# mini version of autofmt_xdate
Expand Down Expand Up @@ -288,20 +290,26 @@ def _remove_labels_from_axis(axis):

def _handle_shared_axes(axarr, nplots, naxes, nrows, ncols, sharex, sharey):
if nplots > 1:
if compat._mpl_ge_3_2_0():
row_num = lambda x: x.get_subplotspec().rowspan.start
col_num = lambda x: x.get_subplotspec().colspan.start
else:
row_num = lambda x: x.rowNum
col_num = lambda x: x.colNum

if nrows > 1:
try:
# first find out the ax layout,
# so that we can correctly handle 'gaps"
layout = np.zeros((nrows + 1, ncols + 1), dtype=np.bool)
for ax in axarr:
layout[ax.rowNum, ax.colNum] = ax.get_visible()
layout[row_num(ax), col_num(ax)] = ax.get_visible()

for ax in axarr:
# only the last row of subplots should get x labels -> all
# other off layout handles the case that the subplot is
# the last in the column, because below is no subplot/gap.
if not layout[ax.rowNum + 1, ax.colNum]:
if not layout[row_num(ax) + 1, col_num(ax)]:
continue
if sharex or len(ax.get_shared_x_axes().get_siblings(ax)) > 1:
_remove_labels_from_axis(ax.xaxis)
Expand Down