On 12/05/2014 06:54 AM, Charles Vellutini wrote:
Hi,

I have Spyder 2.3.2 installed.

What is OS and version?


The variable explorer can now display DataFrames, and this is a major
improvement.

Now there appears to be a bug when a column is made of timestamps and
when that column is _not_ an index.

In the code below, df0 can be viewed without problem in the variable
explorer, but df1 fails with error "TypeError: bad operand type for
abs(): 'NaTType'".

I'm on Linux(OpenSuse 13.1) with Spyder 2.3.2 and do not get the error. I do see that df0 in the Variable Explorer has the same value as df1 in the console. Actually just found it is more complicated than that, see below:


In IPython console

df0
Out[33]:
                   0 OtherIndex
2012-05-01 -0.803744          0
2012-05-02 -0.355662          1
2012-05-03  0.446325          2

df1
Out[34]:
       index         0 OtherIndex
0 2012-05-01 -0.803744          0
1 2012-05-02 -0.355662          1
2 2012-05-03  0.446325          2




From Variable Explorer

If I double click on the df0 variable I get the values for df1. If I double click on the df1 variable nothing happens.

If I right click the variable and select Copy and then paste somewhere else I get the correct values:

df0

                   0 OtherIndex
2012-05-01 -0.803744          0
2012-05-02 -0.355662          1
2012-05-03  0.446325          2


df1

       index         0 OtherIndex
0 2012-05-01 -0.803744          0
1 2012-05-02 -0.355662          1
2 2012-05-03  0.446325          2



Thanks


##########code##############

import pandas as pd

import numpy as np


dates = [pd.datetime(2012, 5, 1), pd.datetime(2012, 5, 2),
pd.datetime(2012, 5, 3)]


ts = pd.Series(np.random.randn(3), dates)

df0=pd.DataFrame(ts)

df0['OtherIndex']=('0','1','2')

df1=df0.reset_index('OtherIndex')


###########end of code##########

--
You received this message because you are subscribed to the Google
Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.


--
Adrian Klaver
[email protected]

--
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to