i += 1
can be used to shorten
i = i + 1
Now, I really want some
.=
operator to shorten painfull stuff like
some_long_df_name['some_equally_long_column_name'] = some_long_df_name['some_equally_long_column_name'].do_method()
into
some_long_df_name['some_equally_long_column_name'] .= do_method()
- I know that i+=1 is not exactly the same as i = i+1 (inplace vs reassigning, see also the answer on this SO post What is the difference between i = i + 1 and i += 1 in a 'for' loop?)
- I looked at the
.__iXXX__
methods from python https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types and couldnt find what I was looking for.
So mostly I am looking for a good explanation why this operator/method isnt there, or some python hack/trick to overload/construct this operator myself.
Thanks !!