DataFrame Pandas 求某行某列的某个字符的个数
求df res中“product”列中“,”字符的个数 并生成新的列“num_sold”
res['num_sold'] = res['product'].str.count(',') +1
DataFrame Pandas 求某行某列的某个字符的个数
求df res中“product”列中“,”字符的个数 并生成新的列“num_sold”
res['num_sold'] = res['product'].str.count(',') +1