Posts by gabra • 146 points
4 posts
-
1
votes2
answers1120
viewsA: How to keep zero left on import in Python?
You can define the dtype at the time of import. For example: candidatos = pd.read_csv("candidatos_excel_cpfinteiro_csv.csv",sep=';', encoding = 'latin_1', dtype=str) It is also possible to define…
-
1
votes2
answers1318
viewsA: python: compare list containing multiple lists with a different list only
Another possibility is to use the numpy. Using the @Wallace-maxters response data, we can get the amount of hits as follows. import numpy as np respostas = [ ['a', 'b', 'c', 'd', 'e'], ['d', 'c',…
-
0
votes1
answer162
viewsA: Problems with Contour() in python
You can define the range of your vector using the argument extent in the imshow and contour from numpy import exp,arange from pylab import meshgrid,cm,imshow,contour,clabel,colorbar,axis,title,show…
-
1
votes1
answer3572
viewsA: Font size of the caption in a graph made in python
If you add this to the code, all your generated figures will have the same font in the caption. import matplotlib.pyplot as plt plt.rcParams['legend.fontsize'] = 12