Skip to content

DOC: add dynamically generated doc-strings for generic functions #4941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Sep 22, 2013

closes #4717

In [2]: pd.DataFrame.reindex?
Type:       instancemethod
String Form:<unbound method DataFrame.reindex>
File:       /mnt/home/jreback/pandas/pandas/core/generic.py
Definition: pd.DataFrame.reindex(self, *args, **kwargs)
Docstring:
Conform DataFrame to new index with optional filling logic, placing
NA/NaN in locations having no value in the previous index. A new object
is produced unless the new index is equivalent to the current one and
copy=False

Parameters
----------
index : array-like, optional
    New labels / index to conform to. Preferably an Index object to
    avoid duplicating data
columns : array-like, optional
    New labels / index to conform to. Preferably an Index object to
    avoid duplicating data
method : {'backfill', 'bfill', 'pad', 'ffill', None}, default None
    Method to use for filling holes in reindexed DataFrame
    pad / ffill: propagate last valid observation forward to next valid
    backfill / bfill: use NEXT valid observation to fill gap
copy : boolean, default True
    Return a new object, even if the passed indexes are the same
level : int or name
    Broadcast across a level, matching Index values on the
    passed MultiIndex level
fill_value : scalar, default np.NaN
    Value to use for missing values. Defaults to NaN, but can be any
    "compatible" value
limit : int, default None
    Maximum size gap to forward or backward fill
takeable : boolean, default False
    treat the passed as positional values

Examples
--------
>>> df.reindex(index=[date1, date2, date3], columns=['A', 'B', 'C'])

Returns
-------
reindexed : DataFrame

@@ -172,6 +175,30 @@ def set_axis(a, i):
for k, v in ns.items():
setattr(cls, k, v)

# setup any defined generic functions
for name, (g, func) in compat.iteritems(Generic.functions):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel like this should maybe get its own function separate from axes init

@jreback
Copy link
Contributor Author

jreback commented Sep 23, 2013

easy enough

@jtratner
Copy link
Contributor

@jreback Everything that gets defined on NDFrame is available to all subclasses, right? So why bother specifying the classes?

@jreback
Copy link
Contributor Author

jreback commented Sep 23, 2013

its possible that a sub-has an implementtion already (but I guess I can just check that)

@jreback
Copy link
Contributor Author

jreback commented Sep 29, 2013

maybe will use some of this, most is now done in #5034

@jreback
Copy link
Contributor Author

jreback commented Oct 1, 2013

closing in favor of #5052

@jreback jreback closed this Oct 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLN: Incorrect name in docstrings for generic
3 participants