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

ENH: Series from MultiIndex causes segfault #4187

Closed
hayd opened this issue Jul 10, 2013 · 9 comments · Fixed by #4190

Comments

@hayd
Copy link
Contributor

commented Jul 10, 2013

In [3]: m = pd.MultiIndex.from_arrays([[1,2], [3,4]])

In [4]: m
Out[4]:
MultiIndex
[(1, 3), (2, 4)]

In [5]: pd.Series(m)
[1]    786 segmentation fault  ipython

pd.Series(m.values) has same fault (list of tuples)

Probably this should just be disallowed.

@hayd

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2013

Perhaps this should return (not sure):

In [11]: m.to_series()
Out[11]:
1  3    (1, 3)
2  4    (2, 4)
dtype: object
@hayd

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2013

pushing out a fix to NotImplementedError.

Could just as easily return data.to_series(), thoughts?

@jreback

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2013

works for the index case, but not for list of tuples (I would just do NotImplementedError for now)

@hayd

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2013

@jreback what do you mean not for the list of tuples?

In [4]: pd.Series([(1,2), (3,4)])
Out[4]:
0    (1, 2)
1    (3, 4)
dtype: object
@jreback

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2013

hmm...must have been a typo...nvm

@hayd hayd closed this in #4190 Jul 13, 2013

@cpcloud

This comment has been minimized.

Copy link
Member

commented Jul 13, 2013

what's causing the segfault here

@hayd

This comment has been minimized.

Copy link
Contributor Author

commented Jul 13, 2013

@cpcloud that's really weird, what was it doing? Was it just me?

@cpcloud

This comment has been minimized.

Copy link
Member

commented Jul 13, 2013

i can't repro it

In [1]: paste
In [3]: m = pd.MultiIndex.from_arrays([[1,2], [3,4]])
## -- End pasted text --

In [2]: Series(m)
Out[2]: Series([], dtype: object)

In [3]: m
Out[3]:
MultiIndex
[(1, 3), (2, 4)]

In [4]: Series(m.values)
Out[4]:
0    (1, 3)
1    (2, 4)
dtype: object

In [5]: pd.__version__
Out[5]: '0.12.0.dev-e2638e0'

this is the commit right before this PR

@jtratner

This comment has been minimized.

Copy link
Contributor

commented Jul 14, 2013

I was getting a segfault on this too.
On Jul 13, 2013 2:29 PM, "Phillip Cloud" notifications@github.com wrote:

i can't repro it

In [1]: paste
In [3]: m = pd.MultiIndex.from_arrays([[1,2], [3,4]])

-- End pasted text --

In [2]: Series(m)
Out[2]: Series([], dtype: object)

In [3]: m
Out[3]:
MultiIndex
[(1, 3), (2, 4)]

In [4]: Series(m.values)
Out[4]:
0 (1, 3)
1 (2, 4)
dtype: object

In [5]: pd.version
Out[5]: '0.12.0.dev-e2638e0'

this is the commit right before this PR


Reply to this email directly or view it on GitHubhttps://github.com//issues/4187#issuecomment-20924244
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.