Better treatment for complex numbers #1098

Closed
wants to merge 6 commits into from

2 participants

@tkf

This fixes #1083. I checked that the number of failing tests (SKIP=38, errors=5, failures=34) do not increase with these change sets.

BTW, in form_blocks why not simply do

    if float_dict:
        ...

instead of calculating length?:

    if len(float_dict):
        ...
@tkf

Oops I have NOSE_DOCTEST_TESTS=t and NOSE_WITH_DOCTEST=t and that's why I had failing tests. There is no fail/error when I remove these envvars.

tkf added some commits Apr 21, 2012
@tkf tkf ENH: add internals.ComplexBlock 824cb10
@tkf tkf BUG: fix max recursion error in test_reindex_items
It looks like sorting by dtype itself does not work.
To see that, try this snippet:

>>> from numpy import dtype
>>> sorted([dtype('bool'), dtype('float64'), dtype('complex64'),
...         dtype('float64'), dtype('object')])
[dtype('bool'),
 dtype('float64'),
 dtype('complex64'),
 dtype('float64'),
 dtype('object')]
bae8155
@tkf

The bug I fixed in bae8155 is very serious one and it could have effect even without complex number implementation I added. It is probably a bug in numpy. Try the following code and observe sorting fails. I checked with numpy 1.6.1.

>>> from numpy import dtype
>>> sorted([dtype('bool'), dtype('float64'), dtype('complex64'),
...         dtype('float64'), dtype('object')])
[dtype('bool'),
 dtype('float64'),
 dtype('complex64'),
 dtype('float64'),
 dtype('object')]
@tkf

BTW, I am using complex64 here but it should be complex128, right?
I noticed just now.

@wesm
Python for Data member

Yes, should be complex128

@wesm
Python for Data member

Merged this in. Should make a sweep and change complex64 -> complex128 at some point, though

@wesm wesm closed this May 15, 2012
@tkf tkf added a commit to tkf/pandas that referenced this pull request May 16, 2012
@tkf tkf BUG: replace complex64 with complex128
As mentioned in #1098.
78dca17
@wesm wesm added a commit that referenced this pull request May 19, 2012
@tkf tkf BUG: replace complex64 with complex128
As mentioned in #1098.
ad2ad47
@Komnomnomnom Komnomnomnom added a commit that referenced this pull request May 19, 2012
@tkf tkf BUG: replace complex64 with complex128
As mentioned in #1098.
ba6a9c8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment