我试图根据Year
列中已经存在的值向我的DataFrame添加一个Rk
列。我尝试使用下面的代码,但是它将自动将所有值设置为0
。
df['Year'] = np.where(df['Rk'] <= 540, '2017/2018', 0)
df['Year'] = np.where((df['Rk'] >= 541) & (df['Rk'] <= 1135), '2016/2017', 0)
df['Year'] = np.where((df['Rk'] >= 1136) & (df['Rk'] <= 1713), '2016/2017', 0)
答案 0 :(得分:2)
将cut
与指定的垃圾箱一起使用:
public class HumansFragment implenets HumanClick{
@BindView(R.id.recycler_humans)
RecyclerView humansRecyclerView;
@Inject
MyAdapter myAdapter;
.
.
.
public void loadHumans(List<Human> humans) {
myAdapter.init(Humans, this);
humansRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
humansRecyclerView.setAdapter(myAdapter);
}
@Override
public void humansClick(Human human) {
//TODO
}
}