I have multiple pickle files in a folder and I want to first load them and then plot them. Indeed, I want to plot them based on their names. Hence, I need to load them into different data frames or dictionaries, then I plot them. For example, I need to use linear plot when the name of the files consist "linear" and use scatter plot when the names include 'scat'. I can read them individually and then plot them using the below code:
import pickle
with open('path/filename', 'rb') as f:
mydata=pickle.load(f)
f.close()
But the thing is these files are changing, something I have less files sometime more files. So I need to do in an automatic way. Any idea?