Skip to content
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

DOC: Unused order argument in factorize #6926

Closed
TomAugspurger opened this issue Apr 22, 2014 · 5 comments · Fixed by #6930
Closed

DOC: Unused order argument in factorize #6926

TomAugspurger opened this issue Apr 22, 2014 · 5 comments · Fixed by #6930
Labels
API Design Deprecate Functionality to remove in pandas
Milestone

Comments

@TomAugspurger
Copy link
Contributor

def factorize(values, sort=False, order=None, na_sentinel=-1):
    """
    Encode input values as an enumerated type or categorical variable

    Parameters
    ----------
    values : ndarray (1-d)
        Sequence
    sort : boolean, default False
        Sort by values
    order :
    na_sentinel: int, default -1
        Value to mark "not found"

    Returns
    -------
    labels : the indexer to the original array
    uniques : the unique values

    note: an array of Periods will ignore sort as it returns an always sorted PeriodIndex
    """

But it isn't used anywhere. Technically this is an API change, if people aren't using kwargs. So I'll add it to the deprecation list.

@jreback
Copy link
Contributor

jreback commented Apr 22, 2014

gr8!

@jreback jreback added this to the 0.14.0 milestone Apr 22, 2014
@jorisvandenbossche
Copy link
Member

Wouls there be a reason it was there in the first place?

@TomAugspurger
Copy link
Contributor Author

I haven't been able to figure that out. I was thinking maybe something to do with sorting, but there's a sort kwarg.

The docstring was added in #4944, but the order line was left untouched.

@jreback
Copy link
Contributor

jreback commented Apr 22, 2014

prob sort related
if u take it out and nothing breaks then prob ok
mostly this is used internally

kyleam added a commit to kyleam/pymc3 that referenced this issue Sep 20, 2014
The `order` keyword wasn't actually used by `factorize`. See
pandas-dev/pandas#6926.
@jreback
Copy link
Contributor

jreback commented Jan 27, 2016

@wesm what was the original reason for the order kw? (as about to remove it as we deprecated a while back)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants