Python Forum
Index error - columns vs non-column
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Index error - columns vs non-column
#2
Hello,

I've not used Pandas too much but I believe the error is where you are referencing the index. Index, in case you didn't already know is how the code refers to items on a list or table, for example

0. Apple, 1. Pear, 2. Peach

So item 0 is always the first item on the list. Try changing "Date" to the index value of that column.

I don't know if that is the solution, however nobody else replied so I thought I would give it a go.

Kind regards,
James
while dad_has_cigs == True:
    happiness = True
    if dad_has_cigs == False:
    print("Dad come home!")
    happiness = not happiness
    break
Reply


Messages In This Thread
Index error - columns vs non-column - by Vinny - Aug-03-2021, 08:56 PM
RE: Index error - columns vs non-column - by jamesaarr - Aug-05-2021, 10:45 AM
RE: Index error - columns vs non-column - by Vinny - Aug-09-2021, 03:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Converting column of values into muliple columns of counts highland44 0 311 Feb-01-2024, 12:48 AM
Last Post: highland44
  pyscript index error while calling input from html form pyscript_dude 2 1,050 May-21-2023, 08:17 AM
Last Post: snippsat
  Index error help MRsquared 1 847 May-15-2023, 03:28 PM
Last Post: buran
  I'm getting a String index out of range error debian77 7 2,435 Jun-26-2022, 09:50 AM
Last Post: deanhystad
  df column aggregate and group by multiple columns SriRajesh 0 1,099 May-06-2022, 02:26 PM
Last Post: SriRajesh
  Removing the index column from df bnadir55 7 3,271 Apr-05-2022, 02:49 PM
Last Post: snippsat
  Transform 3 Columns into Single Column DaveG 8 1,987 Apr-04-2022, 08:42 AM
Last Post: Pedroski55
  Split single column to multiple columns SriRajesh 1 1,382 Jan-07-2022, 06:43 PM
Last Post: jefsummers
  pandas pivot table: How to find count for each group in Index and Column JaneTan 0 3,420 Oct-23-2021, 04:35 AM
Last Post: JaneTan
  How to remove a column or two columns in a correlation heatmap? lulu43366 3 5,393 Sep-30-2021, 03:47 PM
Last Post: lulu43366

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020