Skip to content
Advertisement

Tag: numpy

Using a for-loop and range function vs a while-loop

I’m looking for a function like range except that the step is a fraction of the previous number generated. So if the fraction was 99/100 the set of numbers might be something like this: 100, 99, 98.01… 0.001 Would this be more efficiently done with a for-loop and range-like function or with just a while-loop? The code I have so

How to vectorize a function with lists as argument?

I need help vectorizing a function in numpy. In Julia, I can do something like that: which returns It takes one sublist at a time from the iterables and expands nothing. In Python, I just can’t get to have a similar behaviour. I tried: but it returns: If I do: I get back: I tried with excluded parameter, but il

Error in implementing autokeras timeseries model

I was trying to implement autokeras TimeSeriesForecaster on a serial dataset. The features and label of the dataset are respectively given below. df1_x = AutoML preparation The dataframe has no NaN values, the shape of the features dataframe is (7111, 8) i.e. a 2D dataframe. But the error came as following: Answer You need to provide validation data to the

Numpy array assignment along axis and index

I have a 3D volume and I modify slices along different axis. (np.take is equivalent of writing self.volume[idx], self.volume[:, idx] and self.volume[:, :, idx]) Finally, I want to assign a new slice in my volume along the axis : This is where I need some help. I can’t figure out a cleaner way of doing this assignment. (I would like

Reflecting 4d symmetric data

I’ve found out that there is no example of how to reflect symmetric 4d data, which can be very useful when 3d simulations wants to be performed using a symmetric plane to reduce calculations(e.g. ANSYS, COMSOL, etc). This example shows a data file structure corresponding to a COMSOL simulation, which has the structure: X, Y, Z, Amplitude The model had

Advertisement