One - One Code All

Blog Content

pandas dataframe 整列置为零和全部统一置为零

Python 统计学-科学计算   2011-04-23 00:23:01

pandas dataframe 整列置零 和 全部统一置零

data[data!=0]=0
data["A"]=0

或者.loc[row_indexer,col_indexer] = value

data.loc[:,:] = 0


上一篇:pandas追加行append
下一篇:python将dict字典转化为dataframe数据框

The minute you think of giving up, think of the reason why you held on so long.