Though there are similar Q & A available and I have tried all the options given in similar question; but not been able to resolve the issue. Seems I am not very clear on error handling on this yet. Appreciate if someone can help.
a = (str['cc'] <- 0.5).shift(1) & (str['co'] <- -0.5)
a[0] = False
str['GL'] = a
str['LS'] = 0
str['LS'][a] = str['KC'][a]
Though I am getting the required output, but with an exception as below.
A value is trying to be set on a copy of a slice from a DataFrame See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy install_nbextension,