Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite45e123

Browse files
update
1 parentc925981 commite45e123

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎pandas/core/frame.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5690,7 +5690,7 @@ def reindex(
56905690

56915691
* None (default): don't fill gaps
56925692
* pad / ffill: Propagate last valid observation forward to next
5693-
valid.
5693+
valid.
56945694
* backfill / bfill: Use next valid observation to fill gap.
56955695
* nearest: Use nearest valid observations to fill gap.
56965696

@@ -5757,7 +5757,7 @@ def reindex(
57575757
... index=index,
57585758
... )
57595759
>>> df
5760-
http_status response_time
5760+
http_status response_time
57615761
Firefox 200 0.04
57625762
Chrome 200 0.02
57635763
Safari 404 0.07
@@ -5770,7 +5770,7 @@ def reindex(
57705770

57715771
>>> new_index = ["Safari", "Iceweasel", "Comodo Dragon", "IE10", "Chrome"]
57725772
>>> df.reindex(new_index)
5773-
http_status response_time
5773+
http_status response_time
57745774
Safari 404.0 0.07
57755775
Iceweasel NaN NaN
57765776
Comodo Dragon NaN NaN
@@ -5783,15 +5783,15 @@ def reindex(
57835783
``method`` to fill the ``NaN`` values.
57845784

57855785
>>> df.reindex(new_index, fill_value=0)
5786-
http_status response_time
5786+
http_status response_time
57875787
Safari 404 0.07
57885788
Iceweasel 0 0.00
57895789
Comodo Dragon 0 0.00
57905790
IE10 404 0.08
57915791
Chrome 200 0.02
57925792

57935793
>>> df.reindex(new_index, fill_value="missing")
5794-
http_status response_time
5794+
http_status response_time
57955795
Safari 404 0.07
57965796
Iceweasel missing missing
57975797
Comodo Dragon missing missing
@@ -5801,7 +5801,7 @@ def reindex(
58015801
We can also reindex the columns.
58025802

58035803
>>> df.reindex(columns=["http_status", "user_agent"])
5804-
http_status user_agent
5804+
http_status user_agent
58055805
Firefox 200 NaN
58065806
Chrome 200 NaN
58075807
Safari 404 NaN
@@ -5811,7 +5811,7 @@ def reindex(
58115811
Or we can use "axis-style" keyword arguments
58125812

58135813
>>> df.reindex(["http_status", "user_agent"], axis="columns")
5814-
http_status user_agent
5814+
http_status user_agent
58155815
Firefox 200 NaN
58165816
Chrome 200 NaN
58175817
Safari 404 NaN

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp