TimeSeries modifies a DataFrame inplace

I think this is a bug:


df1 = pd.DataFrame(data=np.random.rand(5,3), columns = ('a', 'b' ,'c'), index = pd.DatetimeIndex(start='01-01-2015',periods=5, freq='d'))

df2 = df1.copy()

assert df2.equals(df1)

TimeSeries(df2)

assert df2.equals(df1)

results in:


<details class='elided'>
<summary title='Show trimmed content'>&#183;&#183;&#183;</summary>

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-32-8de7d5ef3815> in <module>()
      3 assert df2.equals(df1)
      4 TimeSeries(df2)
----> 5 assert df2.equals(df1)

AssertionError:



In [36]: df2.columns
Out [36]:  Index(['a', 'b', 'c', 'index'], dtype='object')


...i.e. a columns named `index` has been appended.


-Dave


This should be discussed with other devs, can you make an issue on GH with this information?

Bryan

···

On Feb 17, 2016, at 10:58 PM, [email protected] wrote:

I think this is a bug:

df1 = pd.DataFrame(data=np.random.rand(5,3), columns = ('a', 'b' ,'c'), index = pd.DatetimeIndex(start='01-01-2015',periods=5, freq='d'))   
df2 = df1.copy()
assert df2.equals(df1)
TimeSeries(df2)
assert df2.equals(df1)

results in:

---------------------------------------------------------------------------
AssertionError
                            Traceback (most recent call last)

<ipython-input-32-8de7d5ef3815> in <module>()
      3 assert df2.equals(df1)
      4 TimeSeries(df2)
----> 5 assert df2.equals(df1)

AssertionError:

In [36]: df2.columns
Out [36]: Index(['a', 'b', 'c', 'index'], dtype='object')

...i.e. a columns named `index` has been appended.

-Dave

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" 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].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/abd3c965-d99a-4a12-a873-9847d35ce34c%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Opened as 3899 - TimeSeries modifies a pd.DataFrame inplace · Issue #3899 · bokeh/bokeh · GitHub

···

On Friday, 19 February 2016 23:27:53 UTC+10, Bryan Van de ven wrote:

This should be discussed with other devs, can you make an issue on GH with this information?

Bryan

On Feb 17, 2016, at 10:58 PM, [email protected] wrote:

I think this is a bug:

df1 = pd.DataFrame(data=np.random.rand(5,3), columns = (‘a’, ‘b’ ,‘c’), index = pd.DatetimeIndex(start=‘01-01-2015’,periods=5, freq=‘d’))
df2 = df1.copy()

assert df2.equals(df1)

TimeSeries(df2)

assert df2.equals(df1)

results in:


AssertionError

                        Traceback (most recent call last)

in ()

  3 assert df2.equals(df1)
  4 TimeSeries(df2)

----> 5 assert df2.equals(df1)

AssertionError:

In [36]: df2.columns
Out [36]: Index([‘a’, ‘b’, ‘c’, ‘index’], dtype=‘object’)

…i.e. a columns named index has been appended.

-Dave


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” 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].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/abd3c965-d99a-4a12-a873-9847d35ce34c%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.