Skip to content

Commit dc13064

Browse files
committed
Set docstring to raw literal to allow backslashes to be printed (still
had to escape them)
1 parent 295d1e6 commit dc13064

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pandas/core/reshape.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -877,13 +877,13 @@ def lreshape(data, groups, dropna=True, label=None):
877877

878878

879879
def wide_to_long(df, stubnames, i, j, sep="", suffix='\d+'):
880-
"""
880+
r"""
881881
Wide panel to long format. Less flexible but more user-friendly than melt.
882882
883883
With stubnames ['A', 'B'], this function expects to find one or more
884884
group of columns with format Asuffix1, Asuffix2,..., Bsuffix1, Bsuffix2,...
885885
You specify what you want to call this suffix in the resulting long format
886-
with `j` (for example `j`='year')
886+
with `j` (for example `j='year'`)
887887
888888
Each row of these wide variables are assumed to be uniquely identified by
889889
`i` (can be a single column name or a list of column names)
@@ -906,14 +906,14 @@ def wide_to_long(df, stubnames, i, j, sep="", suffix='\d+'):
906906
A character indicating the separation of the variable names
907907
in the wide format, to be stripped from the names in the long format.
908908
For example, if your column names are A-suffix1, A-suffix2, you
909-
can strip the hypen by specifying `sep`='-'
910-
suffix : str, default '\d+'
911-
A regular expression capturing the wanted suffixes. '\d+' captures
909+
can strip the hypen by specifying `sep='-'`
910+
suffix : str, default '\\d+'
911+
A regular expression capturing the wanted suffixes. '\\d+' captures
912912
numeric suffixes. Suffixes with no numbers could be specified with the
913-
negated character class '\D+'. You can also further disambiguate
913+
negated character class '\\D+'. You can also further disambiguate
914914
suffixes, for example, if your wide variables are of the form
915915
Aone, Btwo,.., and you have an unrelated column Arating, you can
916-
ignore the last one by specyfing `suffix`='(!?one|two)'
916+
ignore the last one by specifying `suffix='(!?one|two)'`
917917
918918
Returns
919919
-------

0 commit comments

Comments
 (0)