There are a couple of workarounds:
1: Modify warning
If you want to switch of the warning since its not an error, set
pd.set_option('mode.chained_assignment', xxx)
replace xxx with 'raise' (to raise an exception instead of a warning), 'warn'(to generate default warning), None (to switch off the warning entirely)
2: Modify is_copy
Pandas DataFrame has an is_copy property that is None by default but uses a weakref, by setting is_copy to None, this warning can be avoided.
self.df_rankpct.is_copy = None
3: Use loc to slice subsets
self.df_rankpct.loc[:, ['rankpct_market_value']] = self.df_rankpct.groupby(['Date'])["market_value"].rank( method ="min")
Please refer to these links:
https://www.dataquest.io/blog/settingwithcopywarning/
How to deal with SettingWithCopyWarning in Pandas