Question: I am trying to retrieve data from excel and put them into the following format in python:

```
 dataset={
        'User A': {'Lady in the Water': 2.5, 
                        'Snakes on a Plane': 3.5,
                        'Just My Luck': 3.0, 
                        'Superman Returns': 3.5, 
                        'You, Me and Dupree': 2.5,
                        'The Night Listener': 3.0},

        'Gene Seymour': {'Lady in the Water': 3.0, 
                        'Snakes on a Plane': 3.5,
                        'Just My Luck': 1.5,
                         'Superman Returns': 5.0,
                         'You, Me and Dupree': 3.5, 
                         'The Night Listener': 3.0
                        }}

```

Where the excel file looks like

```
                User A  User B
 Lady in the Water  2.5 3
 Snakes on a Plane  3.5 3.5
 Just My Luck   3   1.5
 Superman Returns   3.5 5
 You, Me and Dupree 2.5 3.5
 The Night Listener 3   3

```

Answer: 
The `pandas` module makes this pretty easy:

```
import pandas as pd
df = pd.read_excel('workbook.xlsx', index_col=0)
dataset = df.to_dict()

```

In this code the `pd.read_excel` function collects all data from the excel file and stores it into a pandas [DataFrame](https://pandas.pydata.org/pandas-docs/stable/dsintro.html#dataframe) variable. Dataframes come with an enormous amount of very powerful [built-in methods for data reorganization and manipulation](https://github.com/pandas-dev/pandas/blob/master/doc/cheatsheet/Pandas_Cheat_Sheet.pdf). One of these methods is the `to_dict`, which is used in the code here to convert the data to nested dictionaries.
Another way is through openpyxl:

```
from openpyxl import Workbook
wb = load_workbook(filename = 'workbook.xlsx')
sheet_ranges = wb['cell range']
values = sheet_ranges['cell locations'].values()
data = values.to_dict()

```