diff --git a/orangecontrib/storynavigation/modules/actionanalysis.py b/orangecontrib/storynavigation/modules/actionanalysis.py index 4df7daf..9807ef4 100644 --- a/orangecontrib/storynavigation/modules/actionanalysis.py +++ b/orangecontrib/storynavigation/modules/actionanalysis.py @@ -221,8 +221,8 @@ def __filter_custom_word_matches(self, story_elements_df, selected_stories, cust current_frame['classification'] = c_col current_frame.rename(columns={cust_tag_col: 'category'}, inplace=True) combined_df = pd.concat([combined_df, current_frame], axis=0) - - combined_df = combined_df[combined_df['category'] not in ['?', 'nan']] + + combined_df = combined_df[~combined_df['category'].isin(['?', 'nan'])] return combined_df.reset_index(drop=True) def calculate_customfreq_table(self, df, selected_stories=None): diff --git a/orangecontrib/storynavigation/modules/actoranalysis.py b/orangecontrib/storynavigation/modules/actoranalysis.py index c5e51a3..e58e0c0 100644 --- a/orangecontrib/storynavigation/modules/actoranalysis.py +++ b/orangecontrib/storynavigation/modules/actoranalysis.py @@ -46,8 +46,9 @@ def __filter_custom_word_matches(self, story_elements_df, selected_stories, cust current_frame['classification'] = c_col current_frame.rename(columns={cust_tag_col: 'category'}, inplace=True) combined_df = pd.concat([combined_df, current_frame], axis=0) - - combined_df = combined_df[combined_df['category'] not in ['?', 'nan']] + + combined_df = combined_df[~combined_df['category'].isin(['?', 'nan'])] + return combined_df.reset_index(drop=True) def __filter_rows(self, story_elements_df, pos_tags):