I have the following code:
self.filtered_rwr = self.rwr[self.rwr['type'].str.contains('Process')]
self.filtered_rwr.insert(0, 'Session', 0)
self.filtered_rwr.loc[:, 'Session'] = self.session_title
In which self.rwr is a dataframe.
My problem is i get a SettingWithCopyWarning on this action when:
- i have no use for self.rwr so i don't care about changing it
- i am using the .loc as instructed on a column which does not exist in the original.
i would prefer to solve the warning, but stop it from popping is also a plausible solution.
Suggestions? Thx