[英]i need to get the value of x when x greater than y
df = pd.DataFrame(json_response["data"]["candles"], columns=['Date', 'Open', 'High', 'Low', 'Close', 'Volume'])
x=400
y=300
if(x > y):
print(x)
Here x
is one column in csv with values and y
another column if the first column x > y
then print value of x
where the column value associated这里
x
是CSV一个柱值和y
另一列如果第一列x > y
然后打印的值x
,其中该列值相关联
Just select the rows meeting your criteria, then print the column you're interested in:只需选择符合您条件的行,然后打印您感兴趣的列:
# result is series
print(df(df["x"]>df["y"])["x"])
# result is array of integers
for result in df(df["x"]>df["y"])["x"].values:
print(result)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.