Skip to content

Multicomparison w/Pandas Series #824

Closed

Description

@jburroni

I wanted to perform MultiComparison using pandas series but it fails.
mod = MultiComparison(x, groups)
this statement never ends (or it doesn't in few minutes).
But, if I do this
mod = MultiComparison(x.values, group.values)
it works perfectly.

Apparently the issue is with unique, inv = np.unique(groups, return_inverse=True) which gives a different value for unique as using unique = np.unique(groups).

I have no created an issue as I couldn't make a synthetic example. Also, I don't know to whom report. Most probably this is not the place and it should be reported to pandas, but as this affects pystatsmodels behavior, I'm writing this email

results:
In [113]: np.unique(groups.values, return_inverse=True)
Out[113]: A
(array([u'A', u'B', u'C'], dtype=object),
array([2, 0, 0, ..., 2, 2, 1]))

In [114]: np.unique(role, return_inverse=True)
Out[114]:
(role
3641 NaN
59108 NaN
43653 NaN
1581 NaN
75610 C
55740 NaN
16712 A
75614 NaN
102468 NaN
55742 NaN
102470 NaN
30488 NaN
102472 C
30489 NaN
4962 NaN
...
38778 NaN
38779 A
38781 NaN
38782 C
38784 NaN
38785 NaN
38786 A
38787 NaN
38789 NaN
38790 NaN
38791 NaN
38792 NaN
38793 NaN
38794 B
38795 NaN
Name: role, Length: 105590,
array([68079, 21442, 5820, ..., 77651, 77652, 24166]))

In [118]: pandas.version
Out[118]: '0.10.1'

In [121]: statsmodels.version
Out[121]: '0.4.3'

Activity

  1. josef-pkt commented on May 9, 2013

    @josef-pkt
    Member

    BUG: there is no asarray in the __init__

    related: enhancements to tukeyhsd in PR #809

    related to pandas support for non-model code

    We might want to use more information that we can get from a pandas
    data structure, but this was written before pandas or without pandas
    in mind. (If groups are a pandas factor, then we don't need to find
    the levels again.)
    weightstats issue #771

  2. jburroni commented on May 25, 2013

    @jburroni
    Author

    beautiful

  3. added a commit that references this issue on Sep 2, 2014
    35215f3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions