0
My x and my y to plot are:
x0_n125n25matriz= [ 3472.222 3501.157 3530.092 3559.028 3587.963 3616.898 3645.833
3674.768 3732.639 3761.574 3819.444 3848.379 3877.315 3906.25
3935.185 3964.12 3993.055 4021.991 4050.926 4079.861 4108.796
4137.731 4166.667 4195.602 4224.537 4253.472 1938.657 1967.593
1996.528 2025.463 2054.398 2083.333 2112.268 2141.204 2170.139
2199.074 2228.009 2459.491 2488.426 2517.361 2546.296 2575.231
2604.167 2633.102 2662.037 2690.972 2719.907 2777.778 2806.713
2835.648 2864.583 2893.518 2922.454 2951.389 2980.324 3009.259
3038.194 3067.13 3125. 3153.935 3182.87 3211.805 3240.741
3269.676 3298.611 3327.546 3356.481 3385.417 3414.352 3443.287]
y15_n0matriz= [-0.16542411 -0.16646451 -0.15804609 -0.16922809 -0.16509723 -0.17315663
-1. -0.16794772 -0.18579247 -0.1910353 -1. -0.17504794
-0.17359474 -0.1910353 -0.23110434 -0.21745199 -0.20903377 -0.20411454
-0.14195609 -0.12418465 -0.02185758 -0.06863125 -0.05559483 -1.
-0.00618082 0.31784786 -0.03661292 -0.0307183 -0.05644441 -0.08442226
-0.06980404 -0.10472111 -0.0879587 -0.12047211 -0.1447231 -0.13637791
-0.17421431 -0.2750271 -0.28981587 -0.29746496 -0.29663548 -0.29411292
-0.26879031 -1. -1. -1. -1. -0.26504059
-0.25901137 -1. -1. -1. -1. -1.
-0.23680369 -0.22844707 -0.22335351 -0.21784316 -0.18085159 -0.16489683
-0.16492188 -0.16724017 -0.16639032 -0.16230818 -0.16707027 -0.16008367
-0.15638411 -0.17402684 -0.19244248 -0.18580143]
From y, I need to delete these -1 from the matrix and delete tbm in the matrix x the values corresponding to this index of the -1 in y, so as not to give dimension error to plot . I did so:
x0_n125n25valores=[]
for i in x0_n125n25:
if i!=0:
x0_n125n25valores.append(i)
x0_n125n25matriz=np.asarray(x0_n125n25valores)
print(x0_n125n25matriz)
print(x0_n125n25matriz.shape)
y15_n0valores = []
for i in y15_n0:
if i>=-1 and i<1:
y15_n0valores.append(i)
y15_n0matriz=np.asarray(y15_n0valores)
y15_n0matrizteste=[] ############### ERRO NESSA PARTE
for i in range(0,len(y15_n0matriz)):
if y15_n0matriz[i]>-1.00000000e+00:
y15_n0matrizteste.append(y15_n0matriz[i])
if y15_n0matriz[i]==-1.00000000e+00:
x0_n125n25matriznovo= np.delete(x0_n125n25matriz,i)
y15_n0matriznovo2 = np.asarray(y15_n0matrizteste)
print(y15_n0matriznovo2)
print(y15_n0matriznovo2.shape)
In the print I saw that I deleted -1 correctly from the y matrix but did not delete the corresponding values in x. Does anyone have any idea of pq? I tried differently but I couldn’t:
for i in range(0,len(y15_n0matriz)):
if y15_n0matriz[i]==-1.00000000e+00:
y15_n0matriznovo = np.delete(y15_n0matriz,i)
x0_n125n25matriznovo= np.delete(x0_n125n25matriz,i)
That way you didn’t delete any point. I don’t know why, help!