How to use pandas more effectively

  1. Use datetime functions within the pandas
  • pd.to_datetime
  • pd.to_Timedelta`
  • Use pd.date_range to generate date range
  1. Avoid for loops that iterate over each row. Use aggregate functions wherever possible. [see this for an example]

  2. If the requirements for plotting are simple and straightforward, consider using in-built plotting functions of pandas. This will not only save on importing additional packages but also code is more sleeker for visualisation with pandas.