Python Forum
TypeError: list indices must be integers or slices, not tuple
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: list indices must be integers or slices, not tuple
#1
Hi,

I'm getting a TypeError: list indices must be integers or slices, not tuple on the following section of code:

df_Germany, err = tr.get_data(['ALVG.DE','SIEGn.DE','BAYGn.DE','DBKGn.DE','DAIGn.DE','SAPG.DE']
                      ['TR.AcquisitionType','TR.AdjSharesTraded','TR.AsRepSharesTraded','TR.TransactionDate'],
                      {'Scale': 6, 'SDate': -1000, 'EDate': 0, 'FRQ': 'D', 'Curn': 'USD'})
df_Germany
Console is telling me the error is in the 2nd line, but i'm stumped. Any help would be appreciated.
Thanks
Reply
#2
There is most probably a missing comma at the end fo the first line.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  using > < for tuple , list,... akbarza 3 469 Feb-05-2024, 01:18 PM
Last Post: deanhystad
  tuple indices must be integers or slices, not str cybertooth 16 11,448 Nov-02-2023, 01:20 PM
Last Post: brewer32
Question mypy unable to analyse types of tuple elements in a list comprehension tomciodev 1 470 Oct-17-2023, 09:46 AM
Last Post: tomciodev
  No matter what I do I get back "List indices must be integers or slices, not list" Radical 4 1,156 Sep-24-2023, 05:03 AM
Last Post: deanhystad
  Change font in a list or tuple apffal 4 2,670 Jun-16-2023, 02:55 AM
Last Post: schriftartenio
  boto3 - Error - TypeError: string indices must be integers kpatil 7 1,230 Jun-09-2023, 06:56 PM
Last Post: kpatil
  Why do I have to repeat items in list slices in order to make this work? Pythonica 7 1,321 May-22-2023, 10:39 PM
Last Post: ICanIBB
  Response.json list indices must be integers or slices, not str [SOLVED] AlphaInc 4 6,364 Mar-24-2023, 08:34 AM
Last Post: fullytotal
Question How to append integers from file to list? Milan 8 1,444 Mar-11-2023, 10:59 PM
Last Post: DeaD_EyE
  "TypeError: string indices must be integers, not 'str'" while not using any indices bul1t 2 2,004 Feb-11-2023, 07:03 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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