Skip to content
Advertisement

Changing plot title through loop

I am new to python and need your help. I have several dataframes. Each dataframe is for one day. So I am using for loop to plot for all dataframe. For each plot I want to add the date in my title. Can anyone help me. I have created a variable ‘date_created and assigned the dates which I want. I want my title to look like below : ‘Voltage vs time 28-01-2022’

JavaScript

Advertisement

Answer

To make code work more effective it would be better to create a dictionary of dataframes and dates (if you haven’t got date column in your dataframe).

JavaScript

Than we will use for loop for elements of this dictionary

JavaScript

Hope this will work for you!

Advertisement