So I have a dataframe with two columns, one being a list of antibiotics and another one quantity.
I have an excel sheet from which I'm extracting the concentration of drugs, say something like 100mg. I then split 100 mg to 100 and mg seperately and wanna add the 100 to the quantity column of the dataframe. This works fine.
Now, if I want to add another value to the same row in the same column, how do i do that?
For example:
now my dataframe looks like this:
Antibiotic quantity
azithromycin 100
And If i wanna add another 100 to the quantity, and make it like this:
Antibiotic quantity
azithromycin 200
How do I do that? Could someone help me out please?
if it's named df and the antibiotics are row.names
## (will add 100 to every cell in the row)
df['azithromycin',] <- df['azithromycin',]+100
## (will add 100 to first column)
df['azithromycin',1] <- df['azithromycin',1]+100
Hi thanks for this.
I tried rbind() and i guess it wokrs, so the syntax i gave is: