I have a dictionary called master that has values in the format of.
{
'Company': {
'App': 4,
'App2': 5,
'App3': 82,
etc}
'Company2': {
'App': 3,
'App2': 1,
'App3': 48,
etc}
'Company3' etc
I tried a few different answers:
with open('test.csv', 'wb') as f:
writer = csv.writer(f)
for row in myDict.iteritems():
writer.writerow(row)
other questions related to this but none gave the output I was looking for.
Need the output in either a csv or xslx to be formatted as
Companys as the column headers starting in Column B going across and the Apps Going down the rows in Column A starting in Row 2 with the count for each app filling in the rows under the columns for each associated Company.
Only seem to get outputs that are not separating into columns correctly or do not get the count included correctly.
master = {}
business_list = ['Company1','Company2','Company3'etc]
for business in business_list:
selected_business_apps = {}
curr_business_apps = business_map.get(business)
freqs = Counter (curr_business_apps)
for key, val in freqs.items():
if key in app_map.keys():
selected_business_apps[key] = val
master[business] = selected_business_apps