11from pandas.plotting import register_matplotlib_converters
12
13matplotlib.use("agg")
14import matplotlib.pyplot as plt15
16# Workaround a pandas dataframe to matplotlib issue
17register_matplotlib_converters()
Imports for the same package are scattered and not grouped together. It is recommended to keep the imports from the same package together. It makes the code easier to read.
Not preferred:
import os
import sys
from os import listdir
import time
from os.path import isfile, join
Preferred:
import os
from os import listdir
from os.path import isfile, join
import sys
import time