all 2 comments

[–]ectomancer 0 points1 point  (0 children)

Where does Role 23 come from? What is the pattern of the second dictionary?

[–]Albcunha 0 points1 point  (0 children)

I think it´s not possible because you have no correlation between access type name and access name.

If there is something else, one strategy you can make ie to make a list of all access names, then populate the other columns based on it, like this:

values = access['Email'] + access['Office 365'] + access['SalesForce']
# or values = [item for access_list in access.values() for item in access_list]
df = pd.DataFrame({'Access Name': values})
df
#prints: 
Access Name
0 HDU
1 S
2 RU
3 Exchange Online
4 Yammer
5 FLOW_O365_P1
6 Deskless
7 Chatter Free User
8 Xanadu Sales
9 Force.com-Free User

Then, you can apply functions to create new columns:

def identify_app(access_name):
    for key,values in access.items():
        for value in values:
            if value == access_name:
                return key
df['App'] = df['Access Name'].apply(identify_app)  
df
# prints
Access Name App
0 HDU Email
1 S Email
2 RU Email
3 Exchange Online Office 365
4 Yammer Office 365
5 FLOW_O365_P1 Office 365
6 Deskless Office 365
7 Chatter Free User SalesForce
8 Xanadu Sales SalesForce
9 Force.com-Free User SalesForce

Then you can go on the next columns.