I often find myself writing code like the following (oversimplfied example)
df = read_csv('customer_data_export.csv') df2 = df.query("date > '2017-01-10'") data = df_filtered.groupby('transaction_id').sum() plot_data = pivot_table(data, columns='weekday', rows='n_items') # Etc etc
Basically the problem is that while it's relatively easy to come up with semantic names for columns (as random variables) it's hard for me to come up with meaningful names for each step of transformed dataframe. Additionally I prefer to have short names to make the code easier to type. (Working in Jupyter notebook, the tab-completion isn't the best).
What are some best practices that people follow with this kind of thing?