Posts by Patricia Padula Lopes • 183 points
11 posts
-
1
votes1
answer235
viewsQ: How to sort a python dictionary in descending order?
How can I order this dictionary so that it is in descending order: dict= {'1': array([44, 32, 56, 57, 43, 21, 36, 35, 39, 27, 23, 24, 25, 26, 31, 28, 29, 30, 20, 22, 18, 19, 8, 1, 33, 2, 3, 4, 0, 6,…
-
1
votes2
answers94
viewsQ: How to name the keys of a dictionary from a list (array)?
If I have a dictionary of this kind: dados = {"indice1": [1, 2, 3], "indice2": [4, 5, 6]} and want to name its keys: indice1, indice2 with the following array: names= ['nome1', 'nome2'] I can do…
-
-3
votes1
answer203
viewsQ: How to name the indexes of an array of arrays according to another array?
Having the following array of arrays array1=[indice1[1,2,3], indice2[4,5,6]] and the second array2=['nome1','nome2'] How to make the first array (array of arrays = array1) have the same names in its…
-
0
votes1
answer89
viewsQ: How to read an array of arrays and save each array[ ] into a different variable to run function with barplot?
How can I read this array of arrays: [45 32 56 57 44 21 36 35 39 23 24 27 25 26 31 28 29 30 20 22 18 8 19 1 33 2 3 4 0 6 7 9 17 10 11 12 49 55 13 14 15 16 52 46 43 34 41 37 40 5 54 51 53 47 38 42 50…
-
4
votes1
answer82
viewsA: What is the bincount method of numpy for/what?
This method counts the occurrence of each method in the array. o número 0 aparece 1 vez O número 1 aparece 3 vezes O número 2 aparece 1 vez o número 3 aparece 1 vez 0 0 0 These zeros are up to reach…
-
0
votes2
answers64
viewsQ: How to select methods in a function and add results in a list?
I’m trying with a function of this kind, which is in my main: if __name__ == "__main__": run_experiment(outros_parametros,['LA', 'RF', 'DT', 'ARD', 'PCA']) Cause only a few methods to be selected,…
-
3
votes1
answer65
viewsQ: PCA method for Feature Selection - How do I resolve the raise Exception("Data must be 1-dimensional" error)?
I am trying to implement the PCA method for Feature Selection from the following functions: #Função que permitirá rankear as features mais importantes em um barhplot def ranks_PCA (x_train, y_train,…
-
1
votes1
answer155
viewsQ: Convergencewarning in the Lasso CV method - What can I do to solve the problem?
Could someone help me with this mistake? Convergencewarning: Objective Did not converge. You Might want to Increase the number of iterations. Duality gap: 3.5998713265016704, tolerance:…
-
1
votes2
answers93
viewsQ: How to create multiple columns using the values of one in pandas?
I have the following code: df = pd.DataFrame(repeat_R) print(df) The dataframe I have is like this: 0 0 0.583822 1 0.582975 2 0.541191 3 0.526122 4 0.547239 5 0.555875 6 0.556838 7 0.524316 8…
-
3
votes2
answers440
viewsQ: How to do a subtraction operation between two columns of a dataframe and then add the result with another column?
I have this code: dados_train = pd.read_csv('arquivo.csv', delimiter=",") y = ((dados_train.pop('col_name1') - dados_train.pop('col_name2')) + (dados_train.pop('col_name2') When I try to run just…
pythonasked Patricia Padula Lopes 183 -
1
votes1
answer1643
viewsQ: Turning a table column into a list in Python
importances_DT = pd.DataFrame({'feature':x.columns,'importance':np.round(decision_tree.feature_importances_,3)}) importances_DT =…