BUG: str.format() raises keyerror
- [x] I have checked that this issue has not already been reported.

- [x] I have confirmed this bug exists on the latest version of pandas.

- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.

---

**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.

#### Code Sample, a copy-pastable example

```python
# Your code here
import pandas as pd
import numpy as np
data=pd.Series([1,2,3,4,5],index=['a', 'b', 'c', 'd', 'e'])
d=7
l=[11,12,13,14,15]
print(data['a'])                    #->prints 1, as expected
print("{s}".format(s=d))            #->prints 7, as expected
print("{s[0]}".format(s=l))         #->prints 11, as expected
print("{s}".format(s=data))         #->prints data, as expected
print("{s.a}".format(s=data))       #->prints 1, as expected
# combining above methods
print("{s['a']}".format(s=data))    #->returns keyError 'a', 1 expected
```

#### Problem description

While replacing placeholders with data from variables/ attributes into a text file, it works fine (see example with d=y). However, when doing the same for data in a series/dataframe, it cannot be found. 

#### Expected Output

The data in the indexed row. 

#### Output of ``pd.show_versions()``

<details>

commit           : None
python           : 3.8.3.final.0
python-bits      : 64
OS               : Windows
OS-release       : 10
machine          : AMD64
processor        : Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
byteorder        : little
LC_ALL           : None
LANG             : None
LOCALE           : Dutch_Netherlands.1252

pandas           : 1.0.5
numpy            : 1.18.5
pytz             : 2020.1
dateutil         : 2.8.1
pip              : 20.1.1
setuptools       : 49.2.0.post20200714
Cython           : None
pytest           : None
hypothesis       : None
sphinx           : None
blosc            : None
feather          : None
xlsxwriter       : None
lxml.etree       : None
html5lib         : None
pymysql          : None
psycopg2         : None
jinja2           : 2.11.2
IPython          : 7.16.1
pandas_datareader: None
bs4              : None
bottleneck       : None
fastparquet      : None
gcsfs            : None
lxml.etree       : None
matplotlib       : 3.2.2
numexpr          : None
odfpy            : None
openpyxl         : None
pandas_gbq       : None
pyarrow          : 0.15.1
pytables         : None
pytest           : None
pyxlsb           : None
s3fs             : None
scipy            : 1.5.0
sqlalchemy       : 1.3.17
tables           : None
tabulate         : None
xarray           : None
xlrd             : None
xlwt             : None
xlsxwriter       : None
numba            : None

</details>
