How to create a nested dictionary from a list of lists

I want to create a nested dictionary from a list of lists.

Input:

[[a, b, c], [1, 'a', 'x'], [2, 'b', 'y']]

The main dictionary must have index as keys. The first list has the items to pass as keys to the nested dictionaries, and the following lists have the items to pass as values:

Desired output:

{0: {a:1, b:'a', c:'x'},
 1: {a:2, b:'b', c:'y'}}

I tried the following code, but it doesn’t return each item as a nested dictionary:

output = {a[0]: list(a[1:]) for a in zip(*rows)}

Any help will be appreciated. Thanks

Answer

Here is a solution you can give it a try,

print({
    k: v for k, v in enumerate(dict(zip(val[0], v)) for v in val[1:])
})

{0: {'a': 1, 'b': 'a', 'c': 'x'}, 1: {'a': 2, 'b': 'b', 'c': 'y'}}