Posts by Fagner Sá • 9 points
5 posts
-
0
votes2
answers6769
viewsA: Convert pandas data frame to array
Another method you can use is the to_numpy() This method converts a Dataframe into a Numpy array. df.to_numpy() array([[nan, 0.2, nan], [nan, nan, 0.5], [nan, 0.2, 0.5], [0.1, 0.2, nan], [0.1, 0.2,…
-
0
votes3
answers7021
viewsA: How to change the type of a column in Pandas?
You can fill in the missing data with 0 zeros using the method fillna cand_doacoes['CPF_CNPJ_doador'].fillna(0) This form is easier. Then you change the name and/or type of the column.…
-
0
votes3
answers1073
viewsA: How to change CSV in Python and Pandas?
An idea.. You can use the pandas cut command. To demonstrate how you use, instead of importing a list, I did it with a list. import pandas as pd idades = [21, 33, 15, 21, 28, 60, 35, 19, 41, 10, 18,…
-
0
votes3
answers773
viewsA: Pandas does not find file
You can use the command pwd to find out where Jupyter Notebook is running. By default, the system will fetch the file in this directory. To read in a different folder, you need to put the "…
-
0
votes2
answers195
viewsA: Question about entering items in a list with indexes inside Python brackets
As you said yourself, when using [2:2] Python makes an insertion in the list. Already when using [2:3], a replacement is executed. Try for example to make list [:3] = "Q". You will check that…