usei o código da aula
fig = plt.figure(figsize=(5,4))
eixo = fig.add_axes([0,0,1,1])
explodir = [0.1, 0, 0, 0, 0, 0.1, 0.1]
eixo.pie(temperatura_por_dia_da_semana, labels=temperatura_por_dia_da_semana.index,
autopct='%.1f%%', explode=explodir, shadow=True)
eixo.set_title('Temperatura por dia da semana', fontsize=15, pad=10)
Mas está dando esse erro:
ValueError Traceback (most recent call last)
Input In [44], in <cell line: 6>()
2 eixo = fig.add_axes([0,0,1,1])
4 explodir = [0.1, 0, 0, 0, 0, 0.1, 0.1]
----> 6 eixo.pie(temperatura_por_dia_da_semana, labels=temperatura_por_dia_da_semana.index,
7 autopct='%.1f%%', explode=explodir, shadow=True)
8 eixo.set_title('Temperatura por dia da semana', fontsize=15, pad=10)
File D:\Anaconda\lib\site-packages\matplotlib\__init__.py:1412, in _preprocess_data.<locals>.inner(ax, data, *args, **kwargs)
1409 @functools.wraps(func)
1410 def inner(ax, *args, data=None, **kwargs):
1411 if data is None:
-> 1412 return func(ax, *map(sanitize_sequence, args), **kwargs)
1414 bound = new_sig.bind(ax, *args, **kwargs)
1415 auto_label = (bound.arguments.get(label_namer)
1416 or bound.kwargs.get(label_namer))
File D:\Anaconda\lib\site-packages\matplotlib\axes\_axes.py:3062, in Axes.pie(self, x, explode, labels, colors, autopct, pctdistance, shadow, labeldistance, startangle, radius, counterclock, wedgeprops, textprops, center, frame, rotatelabels, normalize)
3060 raise ValueError("'label' must be of length 'x'")
3061 if len(x) != len(explode):
-> 3062 raise ValueError("'explode' must be of length 'x'")
3063 if colors is None:
3064 get_next_color = self._get_patches_for_fill.get_next_color
ValueError: 'explode' must be of length 'x'