I am trying to reverse dictionary. I have a dictionary called person_to_networks. This function works fine, but
my reverse function gives me an error. It says 'function' object is not subscriptable
.
The text file contains person's name, networks and friends' names. Here is the text
def person_to_networks(profiles_file):
"""
(file open for reading) -> dic of {str: list of str}
"""
# initialize data to be processed
This is invert function :
def invert_networks_dict(person_to_networks):
"""
(dict of {str: list of str}) -> dict of {str: list of str}
Return a "network to people" dictionary based on the given
"person to networks" dictionary.
"""
I appreciate your help in advance!