@@ -7087,8 +7087,8 @@ def sort_values(
7087
7087
using the `natsort <https://github.com/SethMMorton/natsort>` package.
7088
7088
7089
7089
>>> df = pd.DataFrame({
7090
- ... "time": ['0hr', '128hr', '72hr', '48hr', '96hr'],
7091
- ... "value": [10, 20, 30, 40, 50]
7090
+ ... "time": ['0hr', '128hr', '72hr', '48hr', '96hr'],
7091
+ ... "value": [10, 20, 30, 40, 50]
7092
7092
... })
7093
7093
>>> df
7094
7094
time value
@@ -9035,8 +9035,8 @@ def update(
9035
9035
We can also choose to include NA in group keys or not by setting
9036
9036
`dropna` parameter, the default setting is `True`.
9037
9037
9038
- >>> l = [[1, 2, 3], [1, None, 4], [2, 1, 3], [1, 2, 2]]
9039
- >>> df = pd.DataFrame(l , columns=["a", "b", "c"])
9038
+ >>> arr = [[1, 2, 3], [1, None, 4], [2, 1, 3], [1, 2, 2]]
9039
+ >>> df = pd.DataFrame(arr , columns=["a", "b", "c"])
9040
9040
9041
9041
>>> df.groupby(by=["b"]).sum()
9042
9042
a c
@@ -9051,8 +9051,8 @@ def update(
9051
9051
2.0 2 5
9052
9052
NaN 1 4
9053
9053
9054
- >>> l = [["a", 12, 12], [None, 12.3, 33.], ["b", 12.3, 123], ["a", 1, 1]]
9055
- >>> df = pd.DataFrame(l , columns=["a", "b", "c"])
9054
+ >>> arr = [["a", 12, 12], [None, 12.3, 33.], ["b", 12.3, 123], ["a", 1, 1]]
9055
+ >>> df = pd.DataFrame(arr , columns=["a", "b", "c"])
9056
9056
9057
9057
>>> df.groupby(by="a").sum()
9058
9058
b c
@@ -12569,7 +12569,7 @@ def values(self) -> np.ndarray:
12569
12569
A DataFrame where all columns are the same type (e.g., int64) results
12570
12570
in an array of the same type.
12571
12571
12572
- >>> df = pd.DataFrame({'age': [ 3, 29],
12572
+ >>> df = pd.DataFrame({'age': [3, 29],
12573
12573
... 'height': [94, 170],
12574
12574
... 'weight': [31, 115]})
12575
12575
>>> df
@@ -12589,10 +12589,10 @@ def values(self) -> np.ndarray:
12589
12589
results in an ndarray of the broadest type that accommodates these
12590
12590
mixed types (e.g., object).
12591
12591
12592
- >>> df2 = pd.DataFrame([('parrot', 24.0, 'second'),
12593
- ... ('lion', 80.5, 1),
12592
+ >>> df2 = pd.DataFrame([('parrot', 24.0, 'second'),
12593
+ ... ('lion', 80.5, 1),
12594
12594
... ('monkey', np.nan, None)],
12595
- ... columns=('name', 'max_speed', 'rank'))
12595
+ ... columns=('name', 'max_speed', 'rank'))
12596
12596
>>> df2.dtypes
12597
12597
name object
12598
12598
max_speed float64
0 commit comments