As the question says, I have a data frame which is quite large but looks like:
ID Count ValueX Value 2 Value 3
RowX 1 234. 255. yes. yes
RowY 1 123. 135. 543. 342
RowW 1 234. 235. yes. yes
RowJ 1 123. 115. 543. 342
RowA 1 234. 285. yes. yes
RowR 1 123. 165. 543. 342
RowX 2 234. 255. yes. yes
RowY 2 123. 135. 543. 342
RowW 2 234. 235. yes. yes
RowJ 2 123. 115. 543. 342
RowA 2 234. 285. yes. yes
RowR 2 123. 165. 543. 342
.
.
.
RowX 1233 234. 255. yes. yes
RowY 1233 123. 135. 543. 342
RowW 1233 234. 235. yes. yes
RowJ 1233 123. 115. 543. 342
RowA 1233 234. 285. yes. yes
RowR 1233 123. 165. 543. 342
What I want is to be able to select all the values in column ValueX where the row is RowX for each of the ID numbers 1-1233 and return them in a list.
df.query('1 <= ID <= 1233').loc['RowX', 'ValueX']
RowX 255.0
RowX 255.0
RowX 255.0
Name: ValueX, dtype: float64
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With