Re: [Tutor] Adding a new row to the dataframe with datetime as index

2018-05-21 Thread Asif Iqbal
On Mon, May 21, 2018 at 4:59 PM, Peter Otten <__pete...@web.de> wrote: > Asif Iqbal wrote: > > > On Mon, May 21, 2018 at 9:28 AM, Peter Otten <__pete...@web.de> wrote: > > > >> Asif Iqbal wrote: > >> > >> > Hi, > >> > > >> > I am trying to add a new row to a new date in the dataframe like below >

Re: [Tutor] Adding a new row to the dataframe with datetime as index

2018-05-21 Thread Peter Otten
Asif Iqbal wrote: > On Mon, May 21, 2018 at 9:28 AM, Peter Otten <__pete...@web.de> wrote: > >> Asif Iqbal wrote: >> >> > Hi, >> > >> > I am trying to add a new row to a new date in the dataframe like below >> > >> >df.loc['2018-01-24'] = [0,1,2,3,4,5] >> > >> > And I am getting the following

Re: [Tutor] Adding a new row to the dataframe with datetime as index

2018-05-21 Thread Mats Wichmann
On 05/21/2018 11:17 AM, Asif Iqbal wrote: > I want to overwrite the row > > print ( df.loc['2018-01-24'] ) > 2018-01-24 0.0 1.0 2.0 3.0 4.0 NaN > > > df.loc['2018-01-24'] = [0,1,2,3,4,5] > ValueError: cannot set using a list-like indexer with a different length > than the value given w

Re: [Tutor] Adding a new row to the dataframe with datetime as index

2018-05-21 Thread Asif Iqbal
On Mon, May 21, 2018 at 9:28 AM, Peter Otten <__pete...@web.de> wrote: > Asif Iqbal wrote: > > > Hi, > > > > I am trying to add a new row to a new date in the dataframe like below > > > >df.loc['2018-01-24'] = [0,1,2,3,4,5] > > > > And I am getting the following error > > > > ValueError: can

Re: [Tutor] Adding a new row to the dataframe with datetime as index

2018-05-21 Thread Peter Otten
Asif Iqbal wrote: > Hi, > > I am trying to add a new row to a new date in the dataframe like below > >df.loc['2018-01-24'] = [0,1,2,3,4,5] > > And I am getting the following error > > ValueError: cannot set using a list-like indexer with a different length > than the value > > I do have

[Tutor] Adding a new row to the dataframe with datetime as index

2018-05-21 Thread Asif Iqbal
Hi, I am trying to add a new row to a new date in the dataframe like below df.loc['2018-01-24'] = [0,1,2,3,4,5] And I am getting the following error ValueError: cannot set using a list-like indexer with a different length than the value I do have the right number of columns and I can look