我想跳过返回if(firstAns.getText()!= null)但是java中没有goto。
请帮助并简单。
感谢!!!
EditText firstAns = (EditText) findViewById(R.id.first_ans);
if (firstAns.getText() != null) {
//I want to skip the return or jump down below it
}
return;
答案 0 :(得分:1)
如果你想跳过那样的回报,那么我假设你想在import pandas as pd
import io
temp=u"""X,Flow
6/9/16/ 14:00,15000
6/9/16/ 14:00,55000
6/9/16/ 14:00,35000"""
#after testing replace io.StringIO(temp) to filename
df = pd.read_csv(io.StringIO(temp), index_col='X')
df.index = pd.DatetimeIndex(df.index, format='%m/%d/%y %H:%M').to_period('M')
print (df)
Flow
2016-06 15000
2016-06 55000
2016-06 35000
print (df.groupby(level=0).mean())
Flow
2016-06 35000
firstAns.getText() == null
答案 1 :(得分:0)
您可以创建一个方法:
EditText firstAns =(EditText)findViewById(R.id.first_ans);
if (firstAns.getText() != null) {
//I want to skip the return or jump down below it
methodYouWant();
}
如果文本不为null,则执行方法中的内容,如果为null则不执行任何操作
或者您可以执行以下操作:
if (firstAns.getText() != null) {
//I want to skip the return or jump down below it
}else{
return;
}