top_option_based) return(top_option_based)) 当我像这样使用函数时genre('genre','Crime',2)TypeError: cannot do slice indexing on <class 'pandas.indexes.numeric.Int64Index
我正在尝试用Python语言编写一个简单的函数来做或str.contains中做的事情,下面是代码: length = len(little_string1] == little: return False
对于line if big[i:i+length-1] == little:`` it throws a TypeErrorsaying must be str not int,我很困惑。因为我认为,只要