DOC: added examples for index assignment using Series
- [x] closes #39845
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

can you merge master @marco-georgaklis do you mind using a mask when columns are being set in this docstring so we don't show code that we wouldn't use in practice? Would be good if you can do it for the whole dosctring, not only your changes. Thanks! I'm not quite sure I understand. Should I be using a mask instead of .loc when the docstring is under the .loc property? > I'm not quite sure I understand. Should I be using a mask instead of .loc when the docstring is under the .loc property?

Sorry I wasn't clear. The problem with your changes, is that in pandas we don't use:
```python
>>> df.loc[:, 'shield'] = pd.Series({7: 8, 8: 10, 9: 13})
```

Instead, we would use:
```python
>>> df['shield'] = pd.Series({7: 8, 8: 10, 9: 13})
```

The only case where we'd use `loc` for setting a column, is if there is a mask (a condition on which rows should be updated. Something like:
```python
>>> outstanding_employees = df['performance'] > 80
>>> df.loc[outstanding_employees, 'salary'] = ...
```

So, if you can have a look at the docstring you're updating, check if it makes sense to have an example with a mask, and update it, so the `.loc[:, 'shield']` idiom is not being used, so we don't show code in the docs we wouldn't use, that would be great. Thanks for the pull request, but it appears to be stale. If interested in continuing, please merge in the main branch, address the review, and we can reopen.