Python Forum
[pandas] TypeError: list indices must be integers or slices, not str but type is int.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[pandas] TypeError: list indices must be integers or slices, not str but type is int.
#3
In the line
exercises = df.loc[ix_mg[0][1]].at[m_g[ix_mg[0][0]]]
Look at this part
m_g[ix_mg[0][0]]
Not used pandas in a while is that a valid input for at?

Looking at
https://pandas.pydata.org/docs/reference...me.at.html Wrote:Get value within a Series
df.loc[5].at['B']
This seems like what you are doing so ignore me
Reply


Messages In This Thread
RE: [pandas] TypeError: list indices must be integers or slices, not str but type is int. - by Yoriz - Dec-29-2023, 10:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: unhashable type: 'Series' bongielondympofu 2 791 Mar-14-2024, 06:12 PM
Last Post: deanhystad
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,801 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  New to Pandas. I need help fixing a TypeError kramon19 1 1,873 Dec-30-2020, 02:20 PM
Last Post: snippsat
  Comparing results within a list and appending to pandas dataframe Aryagm 1 2,419 Dec-17-2020, 01:08 PM
Last Post: palladium
  [pandas] How to reshape the list Mekala 6 7,655 Jul-26-2020, 12:49 AM
Last Post: Mekala
  Error Message: TypeError: unhashable type: 'set' twinpiques 4 19,402 May-22-2019, 02:31 PM
Last Post: twinpiques
  Error:unsupported operand type(s) for ** or pow(): 'list' and 'int' mcgrim 3 18,604 Mar-22-2019, 01:29 PM
Last Post: buran
  Inserting data from python list into a pandas dataframe mahmoud899 0 2,697 Mar-02-2019, 04:07 AM
Last Post: mahmoud899
  List and Dictionaries with Pandas Balinor 3 3,082 Aug-20-2018, 10:47 PM
Last Post: ichabod801
  missing pandas even if in conda list metalray 2 3,545 May-29-2018, 12:52 PM
Last Post: metalray

Forum Jump:

User Panel Messages

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