Reputation: 629
I am trying to build up a network using Networkx library in python. Some of the node names are url links. For example, one of the urls are 'http://www.everydayhealth.com/health-recipe/summer-vegetable-cr+\x8cpes.aspx?pos=3'
I am trying to save the network in gml format and it gives me the following error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 111: ordinal not in range(128)
Based on the links I read, I know that the url is a 'string' and not a 'unicode'. I checked it using type(url). But because it gives me the above error it means it does not contain all ASCII characters. So, I tried the following:
u1=url.decode('ascii') It gives me the following error: UnicodeDecodeError: 'ascii' codec can't decode byte 0x8c in position 64: ordinal not in range(128)
How should I go about it? My main purpose is to save this network in a gml format. Any help will be appreciated.
Thank You
Upvotes: 0
Views: 412
Reputation: 56
have you tried to change encoding? this may help you https://docs.python.org/2/howto/unicode.html
Upvotes: 1