Only certain values cannot be retrieved from the data in increments of 0.1

Asked 2 years ago, Updated 2 years ago, 43 views

I am trying to extract values from 0 to 0.9 in increments of 0.1 using pandas.
I can't take out 0.6 for some reason.
We have verified that 0.6 exists, but cannot retrieve it.

aa=pd.DataFrame()
for i in range (10):
    aa=aa.append(b["Gate Voltage [V]"] == 0.100*i]))
aa

Run Results
Enter a description of the image here

The value of 0.6 is stored in the data frame of b, but for some reason it does not appear.

Enter a description of the image here

Copy of column 0.6

.
0.600   1.898000e-10    -3.000000e-14   -1.894200e-10   3.010000e-12    2.200000e-12    0.0 forward 0.0 6.305648e+01    0.0 inf 10  10  rgb(133.0614857142856,87.03999999999999,220.16)

Additional information

aa=aa.append(b["Gate Voltage [V]"] == round(0.1*i,1)])

If you do as you pointed out, the time of 0.7 will not displayed.
We have verified that 0.7 is also present (we saw it before we added it).

Enter a description of the image here

Additional information

zzz=pd.DataFrame()
b=df_register[0][df_register[0]["Body Resistance"]==a[0]]
za=b [b["Gate Voltage [V]"] == 0.7]
za
zzz=zzz.append(za)
za=b [b["Gate Voltage [V]"] == 0.9]
zzz=zzz.append(za)
za=b [b["Gate Voltage [V]"] == 0.8]
zzz=zzz.append(za)
zzz

Running this program does not show up when it is 0.7.
Enter a description of the image here

python pandas

2022-09-29 22:35

2 Answers

aa=pd.DataFrame()
for i in range (6,11):
    aa=aa.append(b["Gate Voltage [V]"]*1000).astype("int")==i*100]))
# aaaa=aa.append((b["Gate Voltage [V]"] == round(0.1*i,1)])
aa

So it worked well.
The decimal point seems to have been bad.

Dear metropolis and akira ejiri,
Thank you.


2022-09-29 22:35

I don't think 0.100*i will be in increments of 0.1.

aa=aa.append(b["Gate Voltage [V]"] == 0.100*i]))

aa=aa.append(b[round(b["Gate Voltage [V]"]], 1) == round (0.100*i, 1)]))

Why don't you correct it as shown in ?


2022-09-29 22:35

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.