Python Forum
TypeError: '(slice(None, None, None), 0)' is an invalid key
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: '(slice(None, None, None), 0)' is an invalid key
#2
I would suggest to put some print functions inside generic_combined_scorer., e.g.

def generic_combined_scorer(x1, o1, ii_1, x2, o2, ii_2, y, h):
        print(o1.columns, o2.columns etc.)  # print all columns names of df's etc
        s1 = h(x1, y)
        s2 = h(x2, y)
        o1[ii_1] = s1
        o2[ii_2] = s2
Don't pass arguments with indicies, e.g. X_subset.iloc[:, ii] could be replaced with X_subset, ii
is already passed, so you can do X_subset.iloc[:, ii] inside generic_combined_scorer. This should simplify debugging.
Reply


Messages In This Thread
RE: TypeError: '(slice(None, None, None), 0)' is an invalid key - by scidam - Jul-17-2019, 11:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Inserting slice of array objects into different slice ThemePark 4 2,538 Apr-01-2020, 01:10 PM
Last Post: ThemePark
  slice per group Progressive 3 5,343 Jul-20-2019, 06:52 AM
Last Post: scidam
  Melt or Slice Grin 0 2,181 Jun-24-2018, 06:02 PM
Last Post: Grin

Forum Jump:

User Panel Messages

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