-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chapter - Additional modules - Tabulate #1
Comments
This issue is not related to tabulate. You have created a set with dictionaries. The elements of a set must be immutable object: number, string, tuple.
|
Still it returns error: |
You are right, sorry for bothering with typo. By the way your book is quit good! |
Hi,
Within chapter - Additional modules - Tabulate (https://pyneng.readthedocs.io/ru/latest/book/12_useful_modules/tabulate.html) found an issue with tabulate. Here is my code:
from tabulate import tabulate
data = {{'IP': '15.0.15.1',
'Interface': 'FastEthernet0/0',
'Protocol': 'up',
'Status': 'up'
},
{'IP': '10.0.12.1',
'Interface': 'FastEthernet0/1',
'Protocol': 'up',
'Status': 'up'},
{'IP': '10.0.13.1',
'Interface': 'FastEthernet0/2',
'Protocol': 'up',
'Status': 'up'},
{'IP': '10.1.1.1',
'Interface': 'Loopback0',
'Protocol': 'up',
'Status': 'up'},
{'IP': '100.0.0.1',
'Interface': 'Loopback100',
'Protocol': 'up',
'Status': 'up'}}
print(tabulate(data, headers='key'))
Traceback (most recent call last):
File "/Users/Retina/PycharmProjects/python-start/Play.py", line 3, in
data = {{'IP': '15.0.15.1',
TypeError: unhashable type: 'dict'
May be something wrong with example or with my script?
The text was updated successfully, but these errors were encountered: