QST: value assignment by using '.loc' with boolean and label indexing
- [Yes] I have searched the [[pandas] tag](https://stackoverflow.com/questions/tagged/pandas) on StackOverflow for similar questions.

- [No] I have asked my usage related question on [StackOverflow](https://stackoverflow.com).

---

#### Question about pandas

To assign values from one column of a dataframe to another column with boolean and label indexing, I found the following code works. But I didn't find any document about it, so I am wondering if this method is proper/safe to use? 
Thanks.

```python
df = pd.DataFrame({'A':np.arange(5),
                 'B':[0,1,0,1,0],
                 'C':-np.ones(5)})
print(df)
df.loc[df['B']==1, 'A'] = df['C']
# Value error if we use 
# df.loc[df['B']==1, 'A'] = -np.ones(5)
print(df)
'''
Output:
   A  B    C
0  0  0 -1.0
1  1  1 -1.0
2  2  0 -1.0
3  3  1 -1.0
4  4  0 -1.0
     A  B    C
0  0.0  0 -1.0
1 -1.0  1 -1.0
2  2.0  0 -1.0
3 -1.0  1 -1.0
4  4.0  0 -1.0
'''
```
