Questions tagged as 'numpy'

1
answer

Python - How to merge row and column values into ndarray

Hello, I'm having the following difficulty, because I'm working with numpy now, I'm inexperienced ... Well, my problem is this: I have a tuple (w, t), where t repeats, so I want to add t as lines, but specifically in the first row of the...
asked by 04.11.2017 / 04:00
1
answer

Manipulation of columns with pandas

I'm running a regression where I have 3 parameters and a column with categories. As sklearn does not recognize categories I transform them into dummies (I create a column for each category and fill it with 1 case belongs to the column categor...
asked by 19.05.2017 / 03:31
1
answer

How to print only the first column of a dataset with numpy?

How to print only the first column of a dataset with numpy? My code: import numpy as np data = np.genfromtxt("iris.data",delimiter = ",",usecols=(0,1,2,3)) print(data) My dataset (part of it): 5.1,3.5,1.4,0.2,Iris-setosa 4.9,3.0,1.4,0...
asked by 30.04.2018 / 14:43
1
answer

Array scheduling in Python

I have problems trying to stagger an array 5x5 . First I caused a null line to go to the last line of the array (it worked), then I tried to make a line that had the highest index stay below the one with a smaller index, but on the line: if p...
asked by 14.10.2017 / 15:27
1
answer

numpy delete method doing strange thing

I was testing the delete method of the array class of the numpy library and something strange happened: I delete the index element 0 from the array, but the index element 1 is excluded. I am not understanding what this delete is doing >>...
asked by 16.10.2017 / 09:44
1
answer

Manipulation of arrays in python with numpy module

How do I do a rows swap of arrays using numpy? I need this to implement the Gauss-Jordan method of partial pivotal linear systems.     
asked by 28.11.2016 / 23:43
1
answer

Problems installing numpy module on windows by pip

I can install other modules using pip , except numpy . I have already tried other forms of installation using easy_install and installation by src , unsuccessful too. Look at the output of the installation attempt wit...
asked by 11.10.2015 / 13:17
0
answers

Absurd performance difference between pygame.surfarray.array3d and array2d

Using pygame.surfarray to handle an image as an array, manipulating any element in a array3d is more than 5 times slower than manipulating a array2d element. / p> See this benchmark: from datetime import * import pygam...
asked by 27.09.2018 / 01:06
1
answer

problem in converting normal array to numpy

The program organizes is done to organize the rows, based on the value of the third column, I did the program and it worked, but when I use numpy array, it gives the error below. I need to use numpy array because it's part of a larger program th...
asked by 24.08.2018 / 03:36
1
answer

How to customize the x-axis of a graph with two axes and for text?

I would like to know how to change my x-axis of a graph with two axes y, since I want to assign the x-axis names of Brazilian states to the x axis. numpy_matrix = df.as_matrix() x = numpy_matrix[0:,0] y1 = numpy_matrix[1:,1] y2 = numpy_matrix[...
asked by 08.08.2018 / 17:57