There is a way to filter in a df column only the rows with a especific word inside the text, like function 'str.contains' just using the .query function ?
This is the code i have:
def filter(self):
build_query = ""
if self.lineEdit_name.Text():
build_query += f'& "{self.lineEdit_name.Text()}" in `name`'
if self.lineEdit_description.Text():
build_query += f'& "{self.lineEdit_description.Text()}" in `desc`'
if self.comboBox_section.currentText():
build_query += f'& "{self.comboBox_section.currentText()}" in `section`'
if build_query:
self.queried_df = self.df.query(build_query[1:])
else:
self.queried_df = self.df
I wanted to search in the description column for keywords.