Skip to content

Commit 42a8e97

Browse files
committed
DOC: Add wide_to_long to release notes.
1 parent 2c5939b commit 42a8e97

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

doc/source/v0.13.0.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,23 @@ Enhancements
615615
ser = Series([1, 3, np.nan, np.nan, np.nan, 11])
616616
ser.interpolate(limit=2)
617617

618+
- Added ``wide_to_long`` panel data convenience function.
619+
620+
.. ipython:: python
621+
622+
import pandas as pd
623+
import numpy as np
624+
np.random.seed(123)
625+
df = pd.DataFrame({"A1970" : {0 : "a", 1 : "b", 2 : "c"},
626+
"A1980" : {0 : "d", 1 : "e", 2 : "f"},
627+
"B1970" : {0 : 2.5, 1 : 1.2, 2 : .7},
628+
"B1980" : {0 : 3.2, 1 : 1.3, 2 : .1},
629+
"X" : dict(zip(range(3), np.random.randn(3)))
630+
})
631+
df["id"] = df.index
632+
df
633+
wide_to_long(df, ["A", "B"], i="id", j="year")
634+
618635
.. _scipy: http://www.scipy.org
619636
.. _documentation: http://docs.scipy.org/doc/scipy/reference/interpolate.html#univariate-interpolation
620637
.. _guide: http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html

0 commit comments

Comments
 (0)