0

## python Tuple 判斷大小問題

``````[('0', '0'), ('0.001', '0.108'), ('0.002', '0.105'), ('0.003', '0.109'), ('0.004', '0.105'), ('0.005', '0.103'), ('0.006', '0.107'), ('0.007', '0.111'), ('0.008', '0.110'), ('0.009', '0.108'), ('0.01', '0.109')]
``````

``````[[0.0, 0.0], [0.001, 0.108], [0.002, 0.105], [0.003, 0.109], [0.004, 0.105], [0.005, 0.103], [0.006, 0.107], [0.007, 0.111], [0.008, 0.11], [0.009, 0.108], [0.01, 0.109]
``````

``````[[0.001, 0.108],[0.003, 0.109],[0.007, 0.111],[0.008, 0.11],[0.009, 0.108], [0.01, 0.109]]
``````
froce iT邦大師 2 級 ‧ 2018-09-17 09:13:52 檢舉

hoolada iT邦新手 5 級 ‧ 2018-09-17 09:57:29 檢舉

### 1 個回答

0
froce
iT邦大師 2 級 ‧ 2018-09-17 10:48:49

https://ideone.com/qJVY2C

``````data_gte = [tuple(float(x) for x in d ) for d in data if float(d[1]) >= 0.108]
``````

hoolada iT邦新手 5 級 ‧ 2018-09-17 12:02:40 檢舉

``````data = [ [float(x)for x in d] for d in data]#我轉完後 我不會單獨寫一個判斷出來
``````

[[0.0, 0.0], [0.001, 0.108], [0.002, 0.105], [0.003, 0.109], [0.004, 0.105], [0.005, 0.103], [0.006, 0.107], [0.007, 0.111], [0.008, 0.11], [0.009, 0.108], [0.01, 0.109]]

``````[[0.001, 0.108],[0.003, 0.109],[0.007, 0.111],[0.008, 0.11],[0.009, 0.108], [0.01, 0.109]]
``````
froce iT邦大師 2 級 ‧ 2018-09-17 12:48:24 檢舉
hoolada iT邦新手 5 級 ‧ 2018-09-17 14:32:18 檢舉