Skip to content

Commit 3861066

Browse files
committed
DOC: Correct wide_to_long docstring
1 parent e854ccf commit 3861066

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pandas/core/reshape/melt.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -371,19 +371,19 @@ def wide_to_long(df, stubnames, i, j, sep="", suffix=r'\d+'):
371371
... 'ht_two': [3.4, 3.8, 2.9, 3.2, 2.8, 2.4, 3.3, 3.4, 2.9]
372372
... })
373373
>>> df
374-
birth famid ht_one ht_two
374+
famid birth ht_one ht_two
375375
0 1 1 2.8 3.4
376-
1 2 1 2.9 3.8
377-
2 3 1 2.2 2.9
378-
3 1 2 2.0 3.2
376+
1 1 2 2.9 3.8
377+
2 1 3 2.2 2.9
378+
3 2 1 2.0 3.2
379379
4 2 2 1.8 2.8
380-
5 3 2 1.9 2.4
381-
6 1 3 2.2 3.3
382-
7 2 3 2.3 3.4
380+
5 2 3 1.9 2.4
381+
6 3 1 2.2 3.3
382+
7 3 2 2.3 3.4
383383
8 3 3 2.1 2.9
384384
385385
>>> l = pd.wide_to_long(df, stubnames='ht', i=['famid', 'birth'], j='age',
386-
sep='_', suffix='\w')
386+
... sep='_', suffix='\w+')
387387
>>> l
388388
... # doctest: +NORMALIZE_WHITESPACE
389389
ht

0 commit comments

Comments
 (0)