
I am working with numpy arrays and and I would like to move a certain value located at certain index by 2 positions on the right while shifting the others element involved on the left by one position ...

I am using Python 3.7 and numpy 1.18. I have a multidimensional numpy array of shape (28, 28, 3) and within this np array, I want to remove the 20% of smallest weights. Removing the 20% of smallest ...

I have a Cprogram from where I call a Python function. I want this Python function to return a ndarray which I then could use in my C code. I need a ndarray, as I want to the Python code to record a ...

So, in my code Z is the output of QAMModem
import numpy as np
bits = np.random.randint(2, size=int(N_bits))
QAM16 = QAMModem(16)
Z=QAM16.modulate(bits)`
Z is a list of 10 elements
How can I ...

I have a numpy array such as arr = np.arange(16).reshape(2,2,2,2)
I want to dynamically access arr[:, dim2, dim3], when I have (dim2, dim3) as a tuple. What is the best way to do this?

I have a numpy array that contains 813698 rows:
len(df_numpy)
Out[55]: 813698
I want to loop through this array using mini batches of 5000.
mini_batch = 5000
i = 0
for each batch in df_numpy:
...

I have a ndarray called test which its shape is (100,180) and the type is
dtype ([('a' , '< f4'), ('b', '< f4'), ('c', '< f4'), ('d', '< f4'),
('e','u1'), ('f', 'u1'), ('g', 'u1'), ('...

X = np.random.randint(0,10,25).reshape(5,5)
rowsums = np.array([sum(row) for row in X])
print(X.shape) >>> (5,5)
print(rowsums.shape) >>> (5,)
all_data = np.append(X, rowsums, ...

I have a function that may return a single value as numpy array:
print(yhat, yhat.shape)
Output: 0.9337081 ()
How to check that numpy array shape is () and if so reshape it to (1,)? So as a result ...

I have a 3dimensional numpy ndarray.
As an example, a 4x4x2 array as following:
array = [
[ [7 1] [8 0] [2 0] [7 1] ]
[ [5 4] [1 4] [6 7] [8 1] ]
[ [3 2] [4 5] [8 6] [6 2] ]
[ [6 4] [1 2] [5 5] ...

I have two numpy array like this,
this is the first one, called "pred_test"
array([2., 2., 2., 2., 2., 1., 2., 2., 2., 3., 2., 2., 3., 2., 2., 2., 2.,
2., 3., 3.], dtype=float32)
and this is ...

Say for example if I have a ndarray(mp) like this:
`mp =
[[2.3980985828756736 6861 1 6861]
[2.4120089384661587 6862 1 6862]
[2.4235102880216637 6863 1 6863]
...
[1.0564918793423272 2418 2418 ...

I have a numpy array:
array([ 6., 13., 10., 9., 5., 4., 4., 4., 3., 5., 4., 20., 6.,
14., 8., 6., 3., 3., 3., 2., 2., 5., 6., 11., 11., 11.,
9., 3., 3., 3., 2., ...

Plotting a fairly large point cloud in python using plotly produces a graph with axes (not representative of the data range) and no data points.
The code:
import pandas as pd
import plotly.express ...

hello I would like you to help and solve my problem. I'm using python 3.7 including tensorflow 2.0.
I'm following a GitHub at that step when I run python I get error. Can anyone help to understand and ...