What is the best way to get data out of DataFrames/save data in DataFrames and keep code legible? I quickly have the problem that my code looks something like this:
df_special_dataframe[(df_special_dataframe[:Date].>=Year).&(df_special_dataframe[:variable1].>=Threshold),:variable1] = An expression of similar length
That makes my code hard to read and work on. I see that part of the solution is to use the shortest names as possible for variables and DataFrames, but is there a better way to handle DataFrames in general?
I know from VBA that there is an “with…end” environment that looks like this:
With theCustomer.Comments
.Add("First comment.")
.Add("Second comment.")
End With
It basically saves you typing “theCustomer.Comments” again. I can imagine that a similar functionality could be implemented for DataFrames or is already existing.