Group small values in a pie chart
This might not be the best solution:

I'm attaching the new code in which I split the data using a threshold and then plot them separately into 2 pie charts:

import matplotlib.pyplot as plt
import pandas as pd

plt.style.use('ggplot')

dic = [{'class a': 26.9,
       'Class b': 18,
       'Class c': 16.8,
       'Class d': 13,
       'Class e': 8.83,
       'Class f': 5.97,
       'Class g': 3.59,
       'Class h': 2.01,
       'Class i': 1.42,
       'Class j': 1.09,
       'Class k': 0.903,
       'Class l': 0.873,
       'Class m': 0.28,
       'Class n': 0.24,
       'Class o': 0.112}]

labels = dic.keys()
sizes = dic.values()

#converting the data into a dataframe
df = pd.DataFrame(dic)
dft = df.transpose()

dft.columns = ['Value']
dft['Class'] = dft.index

#defining the threshold 
threshold = 5
dft_subset1 =  dft[dft['Value'] &lt;= threshold]
dft_subset2 =  dft[dft['Value'] &gt; threshold]

plot1 = dft_subset1.plot.pie(y='Value', figsize=(5, 5))
plot2 = dft_subset2.plot.pie(y='Value', figsize=(5, 5))


Output: