What I want to do, I realized, would look like this:
(t in df[self.target]).any()
But I get:
AttributeError: 'bool' object has no attribute 'any'
You can use the Pandas methods str( docs ).
str
df[self.target].str.contains(t).any()
I assume this is a pandas DataFrame. try it
(df[self.target] == t).any()
EDIT:
any((t in k for k in df[self.target]))
Source: https://habr.com/ru/post/1650236/More articles:The pop-up calendar displays the local date, but the selected date is UTC - javascriptHow to send emails via PHP to GMail? - phpFunction to view the form? - viewRecompile Symfony container manually - dockerHow to create an error handler (404, 500 ...) in Spring boot / mvc? - javaf # correspond to the opposite value - f #(r ->) applicative functor - functorТест Акка Актера: автоматический ответ с помощью TestProbe - scalaМогут ли оптимизация инкрустации и удаления мертвого кода предотвращать создание шаблонов? - c++Why does this akka-http route test never succeed? - scalaAll Articles