Series object has no attribute split. Copy. f = lambda x: len(x["review"].split("disappointed")) -1 reviews["disappointed"] = reviews.apply(f, axis=1).
AttributeError: 'str' object has no attribute 'contains' Any suggestions how I can search for a list of words in a string. python pandas. Share. Improve this question. Follow edited Nov 8 '19 at 21:20. Barmar. 642k 50 50 gold badges 436 436 silver badges 542 542 bronze badges.
The initial error is that you're trying to call split on the whole list of lines, and you can't split a list of strings, only a string. So, you need to split ...
Welcome to the Treehouse Community. The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support.
Splits the string in the Series/Index from the beginning, at the specified delimiter string. Equivalent to str.split (). Parameters. patstr, optional. String or regular expression to split on. If not specified, split on whitespace. nint, default -1 (all) Limit number of splits in output. None, 0 and -1 will be interpreted as return all splits.
The initial error is that you're trying to call split on the whole list of lines, and you can't split a list of strings, only a string. So, you need to split ...
01.04.2015 · Firstly, do not name your variable as list. Secondly list does not have the function split It is str which has it.. Check the documentation for str.split. Return a list of the words in the string, using sep as the delimiter string (emphasis mine) So you need to do