Skip to content

Commit af3c3a3

Browse files
Merge pull request pandas-dev#10348 from jorisvandenbossche/docstrings
DOC: fix docstrings
2 parents e1ee171 + ccd4f21 commit af3c3a3

File tree

4 files changed

+35
-26
lines changed

4 files changed

+35
-26
lines changed

doc/source/release.rst

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ pandas 0.16.2
5353
This is a minor release from 0.16.1 and includes a large number of bug fixes
5454
along with several new features, enhancements, and performance improvements.
5555

56+
Highlights include:
57+
58+
- A new ``pipe`` method, see :ref:`here <whatsnew_0162.enhancements.pipe>`
59+
- Documentation on how to use `numba <http://numba.pydata.org>`_ with *pandas*, see :ref:`here <enhancingperf.numba>`
60+
5661
See the :ref:`v0.16.2 Whatsnew <whatsnew_0162>` overview for an extensive list
5762
of all enhancements and bugs that have been fixed in 0.16.2.
5863

doc/source/whatsnew/v0.16.2.txt

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Highlights include:
1313
- A new ``pipe`` method, see :ref:`here <whatsnew_0162.enhancements.pipe>`
1414
- Documentation on how to use numba_ with *pandas*, see :ref:`here <enhancingperf.numba>`
1515

16-
Check the :ref:`API Changes <whatsnew_0162.api>` before updating.
1716

1817
.. contents:: What's new in v0.16.2
1918
:local:

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2050,7 +2050,7 @@ def sample(self, n=None, frac=None, replace=False, weights=None, random_state=No
20502050
return self.take(locs, axis=axis)
20512051

20522052
_shared_docs['pipe'] = ("""
2053-
Apply func(self, *args, **kwargs)
2053+
Apply func(self, \*args, \*\*kwargs)
20542054
20552055
.. versionadded:: 0.16.2
20562056

pandas/io/json.py

+29-24
Original file line numberDiff line numberDiff line change
@@ -640,34 +640,39 @@ def json_normalize(data, record_path=None, meta=None,
640640
path to records is ['foo', 'bar']
641641
meta_prefix : string, default None
642642
643+
Returns
644+
-------
645+
frame : DataFrame
646+
643647
Examples
644648
--------
645-
data = [{'state': 'Florida',
646-
'shortname': 'FL',
647-
'info': {
648-
'governor': 'Rick Scott'
649-
},
650-
'counties': [{'name': 'Dade', 'population': 12345},
651-
{'name': 'Broward', 'population': 40000},
652-
{'name': 'Palm Beach', 'population': 60000}]},
653-
{'state': 'Ohio',
654-
'shortname': 'OH',
655-
'info': {
656-
'governor': 'John Kasich'
657-
},
658-
'counties': [{'name': 'Summit', 'population': 1234},
659-
{'name': 'Cuyahoga', 'population': 1337}]}]
660-
661-
result = json_normalize(data, 'counties', ['state', 'shortname',
662-
['info', 'governor']])
663-
664-
state governor
665-
Florida Rick Scott
666649
650+
>>> data = [{'state': 'Florida',
651+
... 'shortname': 'FL',
652+
... 'info': {
653+
... 'governor': 'Rick Scott'
654+
... },
655+
... 'counties': [{'name': 'Dade', 'population': 12345},
656+
... {'name': 'Broward', 'population': 40000},
657+
... {'name': 'Palm Beach', 'population': 60000}]},
658+
... {'state': 'Ohio',
659+
... 'shortname': 'OH',
660+
... 'info': {
661+
... 'governor': 'John Kasich'
662+
... },
663+
... 'counties': [{'name': 'Summit', 'population': 1234},
664+
... {'name': 'Cuyahoga', 'population': 1337}]}]
665+
>>> from pandas.io.json import json_normalize
666+
>>> result = json_normalize(data, 'counties', ['state', 'shortname',
667+
... ['info', 'governor']])
668+
>>> result
669+
name population info.governor state shortname
670+
0 Dade 12345 Rick Scott Florida FL
671+
1 Broward 40000 Rick Scott Florida FL
672+
2 Palm Beach 60000 Rick Scott Florida FL
673+
3 Summit 1234 John Kasich Ohio OH
674+
4 Cuyahoga 1337 John Kasich Ohio OH
667675
668-
Returns
669-
-------
670-
frame : DataFrame
671676
"""
672677
def _pull_field(js, spec):
673678
result = js

0 commit comments

Comments
 (0)