Suppose I have a DataFrame generated like so:
import numpy as np
import pandas as pd
np.random.seed(seed=0)
df = pd.DataFrame(index=list('AB'), columns=list('CD'), data=np.random.randn(2,2))
which looks like
C D
A 1.764052 0.400157
B 0.978738 2.240893
and suppose I'd like to increase the value in row A, column C by 1. The way I've found to do this is:
df['C'][df.index.isin(['A'])] += 1
The left hand side seems quite verbose; I was hoping there might be a shorter way to do this?