pandas某一列的某一行 .loc
pandas某一列的某一行, choosed列的第i行:
adata.obs['choosed'] = str(0) for i in range(adata.obs['leiden'].shape[0]): id = str(i + 1).zfill(3) if adata.obs['leiden'].iloc[i] == ip: adata.obs.loc[id, 'choosed'] = str(1) else: adata.obs.loc[id, 'choosed'] = str(0)
Pandas读取某列、某行数据——loc、iloc用法总结_Bigboss7的博客-程序员资料 - 程序员资料
总结的非常全面啊