Could anyone show me how to copy values in the column( m/z ) to a new column if its value equals to 300 or 305? If its value doesn't equal to 300 or 305, put 0 in the new column. It should look as follows.
You could do:
df['300'] = 0
df['305'] = 0
df['300'][df['m/z'] == 300] = 300
df['305'][df['m/z'] == 305] = 305
But i'm sure there might be a better way haha
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.