I'm trying to solve a college activity but I could not transpose the logic into the code.
The case is as follows:
"The user will enter the integers in the same row separated by space.
After the user passes the values, the following values will b...
I'm working on data analysis using Python and for this I'm training algorithms like SVC and K-means. The data used for the training have a fixed spacing between each sample, since they are sampled by an oscilloscope in fixed periods of time, in...
for index, row in candles.iterrows():
if (row['Twintower'] == 1):
I would like to do a second looping from the moment he finds this condition, ie from this index down, or row down, I tried several options
TypeError...
I have the following df:
df = pd.DataFrame({'hora completa':['21:35:00', '22:16:00', '00:50:00', '09:30:00', '14:30:00']})
print(df)
hora completa
0 21:35:00
1 22:16:00
2 00:50:00
3 09:30:00
4 14:30:00
I need to...
Good afternoon,
One question:
Could anyone clarify me how I can make a frequency distribution table: classes; absolute and relative frequency; cumulatively; average values of each class.
I have this function in Matlab
cn = reshape(repmat(sn, n_rep, 1), 1,[]);
In Python I have the following code:
import numpy as np
from numpy.random import randint
M=2
N=2*10**8 ### valor de Dados
n_rep = 3 ## numero de repetições
sn = ran...
I'm a beginner in python and I'm doubtful about array assembly. In the case, I did the following:
import numpy as np
n=3
A = np.zeros((n*n,n*n))
j= 2
i = 2
k = i+n*(j-1)
a = -4
L1 = i-1+n*(j-1)
a1 = 1
L2 = i+1+n*(j-1)
a2 = 1
L3 = k-n
a3 = 1
L4...
I have the following algorithm:
import numpy as np
matriz = np.array(np.zeros(81).reshape(9, 9))
for i in range(1, matriz.shape[0], 3):
for j in range(1, matriz.shape[1], 3):
matriz[i, j] = 255
print(matriz)
It generates the...
I have a problem with this looping, because it is a situation that I can not solve with np.where , why have to run DataFrame to find the value of the gain or loss from another condition, whichever comes first .
It's working but I...