Skip to content

Commit 63fc9fa

Browse files
More changes for hist
1 parent 7c201ba commit 63fc9fa

File tree

2 files changed

+24
-11
lines changed

2 files changed

+24
-11
lines changed

pandas-stubs/core/frame.pyi

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ from pandas._typing import (
164164

165165
from pandas.io.formats.style import Styler
166166
from pandas.plotting import PlotAccessor
167+
from pandas.plotting._core import hist_frame
167168

168169
class _iLocIndexerFrame(_iLocIndexer, Generic[_T]):
169170
@overload
@@ -1308,8 +1309,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
13081309
def pivot(
13091310
self,
13101311
*,
1312+
columns: IndexLabel,
13111313
index: IndexLabel = ...,
1312-
columns: IndexLabel = ...,
13131314
values: IndexLabel = ...,
13141315
) -> Self: ...
13151316
def pivot_table(
@@ -1591,14 +1592,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
15911592
method: Literal["pearson", "kendall", "spearman"] = ...,
15921593
numeric_only: _bool = ...,
15931594
) -> Series: ...
1594-
@overload
1595-
def count(
1596-
self, axis: Axis = ..., numeric_only: _bool = ..., *, level: Level
1597-
) -> Self: ...
1598-
@overload
1599-
def count(
1600-
self, axis: Axis = ..., level: None = ..., numeric_only: _bool = ...
1601-
) -> Series: ...
1595+
def count(self, axis: Axis = ..., numeric_only: _bool = ...) -> Self: ...
16021596
def nunique(self, axis: Axis = ..., dropna: bool = ...) -> Series: ...
16031597
def idxmax(
16041598
self, axis: Axis = ..., skipna: _bool = ..., numeric_only: _bool = ...
@@ -1643,7 +1637,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
16431637
def isin(self, values: Iterable | Series | DataFrame | dict) -> Self: ...
16441638
@property
16451639
def plot(self) -> PlotAccessor: ...
1646-
hist = ...
1640+
hist = hist_frame
16471641
def boxplot(
16481642
self,
16491643
column: _str | list[_str] | None = ...,
@@ -2447,7 +2441,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
24472441
self,
24482442
buf: None = ...,
24492443
*,
2450-
level: None = ...,
24512444
columns: Sequence[Hashable] | Index | Series | None = ...,
24522445
col_space: int | list[int] | dict[Hashable, int] | None = ...,
24532446
header: _bool | Sequence[_str] = ...,

pandas-stubs/plotting/_core.pyi

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,3 +435,23 @@ class PlotAccessor:
435435
) -> npt.NDArray[np.object_]: ...
436436

437437
density = kde
438+
439+
def hist_frame(
440+
data: DataFrame,
441+
column: Axes | None = None,
442+
by=None,
443+
grid: bool = True,
444+
xlabelsize: int | None = None,
445+
xrot: float | None = None,
446+
ylabelsize: int | None = None,
447+
yrot: float | None = None,
448+
ax=None,
449+
sharex: bool = False,
450+
sharey: bool = False,
451+
figsize: tuple[int, int] | None = None,
452+
layout: tuple[int, int] | None = None,
453+
bins: int | Sequence[int] = 10,
454+
backend: str | None = None,
455+
legend: bool = False,
456+
**kwargs,
457+
) -> Axes | list[Axes]: ...

0 commit comments

Comments
 (0)