Questions tagged as 'numpy'

1
answer

Import csv as float

Good morning! I have the following problem, I'm importing a base for python, but I can not manipulate it (average), because it's like str, I need to import all the values to come as float. data = pd.read_csv ('C: \ path \ df.csv', index_co...
asked by 07.07.2018 / 14:48
0
answers

Python: choosing rows in an array: IndexError: too many indices for array

I'm trying to build a model from an array with 572 rows and 8 columns loaded with NumPy. I defined the sets as: train_x = x_vals[(11:34, 46:98, 110:268, 280:342, 354:408, 420:428, 440:478, 490:538, 550:571] test_x = x_vals[0:10, 35:45, 99:109...
asked by 14.06.2018 / 22:34
1
answer

How to define the tangent function in python?

I would like someone to help me define the tangent function using python with constraints on points where the function does not exist (pi / 2 + k * pi (k integer).     
asked by 15.04.2018 / 16:08
1
answer

Numpy dType complex, with fixed array of variables, using function fromfile to import binary file

I'm reading a complex binary file, where there is a fixed array of values, could anyone help? The structure is: 8 bytes = Long Current Time (unixtime stamp) 8 bytes = Long Current Time (unixtime stamp in MiliSeconds)...
asked by 20.12.2017 / 16:49
1
answer

How to transform a numpy.array of size 497305 into a smaller one of 4999 without adding new elements in the calculation?

I am analyzing an audio and my ML model of scikit learn generates an array of probabilities that a certain element in the array corresponds to an "A" category used to train the model. Each element of the array corresponds to a probability of...
asked by 11.12.2017 / 19:48
1
answer

I'm trying to make my chart start from position 0 using hist ()

Using USAGE_PLOT is easy to do but I want to do and learn how to use hist. the same way it is in the image below in which it was used usage_plot(trip_data, 'duration', ['duration < 60'], boundary = 0, bin_width = 5) ButI'mtryingsever...
asked by 18.09.2017 / 00:24
0
answers

How can I trace a real-time spectrogram by reading data from an ADC like the "MCP3008" connected to the GPIO of Raspberry?

My idea is to read data from an ADC like the MCP3008 connected to the Rasperry GPIO, from the readings plotting a real-time graph of the signal processed by a FFT (fourrier rapid transform) or STFT (transformed short of fourrier) Example...
asked by 07.06.2017 / 19:43
1
answer

Select specific day in an np.array containing datetime

I have a np.array.astype ('Datetime [s]') called T with several days at random times. I need to select a few days for separation. I tried: for i in np.arange(MinTime,MaxTime,np.timedelta64(1, 'D')): mask = (T > i) & (T < (...
asked by 05.08.2016 / 01:32
1
answer

Does anyone know how to use a variable of type array to access a position in an array of numpy?

I have A = np.array ([[1,2], 3]) and I want to use [0,1] to make A [0,1] being [0,1] a variable. Would get 2. Does anyone know how to do this?     
asked by 05.12.2018 / 12:13
1
answer

I want to convert Timedelta to float

I have a Dataframe in which one of the columns is the time interval in days between searching from one row to another, the data in that column is in the form Timedelta, as in the example: Timedelta ('61 days 00:00:00 ') I need to convert this...
asked by 23.10.2018 / 03:31