Posts by Cleo Batista • 16 points
2 posts
-
0
votes3
answers69
viewsA: Matplotlib sorting using index as bar denominator
Convert the index to a string list, it is a way to circumvent the captive matplotlib ordering. `xs = df.index.map(str) ys = df['total'] plt.bar(xs, ys, color='#DDA63A')`…
-
0
votes2
answers163
viewsA: Change class attributes from generic method
Use the setattr. Your function altera_attribute will look like this: def altera_atributo(self, var_com_o_nome_do_atributo, valor): setattr(self, var_com_o_nome_do_atributo, valor)…
python-3.xanswered Cleo Batista 16