NetworkX error while loading pajek network











up vote
0
down vote

favorite












I'm trying to load a network in pajek format .net into a graph in python. It seems to be an easy task, but I'm getting an error that I don't understand:



Traceback (most recent call last):
File "insta.py", line 4, in <module>
G = nx.read_pajek("instaedges.net")
File "<decorator-gen-588>", line 2, in read_pajek
File "C:UsersMarcinAppDataLocalProgramsPythonPython37-32libsite-packagesnetworkxutilsdecorators.py", line 240, in _open_file
result = func_to_be_decorated(*new_args, **kwargs)
File "C:UsersMarcinAppDataLocalProgramsPythonPython37-32libsite-packagesnetworkxpajek.py", line 163, in read_pajek
return parse_pajek(lines)
File "C:UsersMarcinAppDataLocalProgramsPythonPython37-32libsite-packagesnetworkxreadwritepajek.py", line 205, in parse_pajek
l, nnodes = l.split()
ValueError: too many values to unpack (expected 2)


my code:



import networkx as nx
G = nx.read_pajek("instaedges.net")
print(nx.info(G))


What is the problem here?
I'm using NetworkX 2.2 and python 3.7.0










share|improve this question




















  • 1




    Potentially, "instaedges.net" is not in the correct format. Without the file, this will be impossible to determine though. I would link to the file (put it on github, pastebin or google drive).
    – Paul Brodersen
    Nov 7 at 17:35










  • Yes, it semms that it is indeed the problem. Possibly the conversion of formats was faulty. Thanks!
    – MMis
    Nov 12 at 14:11















up vote
0
down vote

favorite












I'm trying to load a network in pajek format .net into a graph in python. It seems to be an easy task, but I'm getting an error that I don't understand:



Traceback (most recent call last):
File "insta.py", line 4, in <module>
G = nx.read_pajek("instaedges.net")
File "<decorator-gen-588>", line 2, in read_pajek
File "C:UsersMarcinAppDataLocalProgramsPythonPython37-32libsite-packagesnetworkxutilsdecorators.py", line 240, in _open_file
result = func_to_be_decorated(*new_args, **kwargs)
File "C:UsersMarcinAppDataLocalProgramsPythonPython37-32libsite-packagesnetworkxpajek.py", line 163, in read_pajek
return parse_pajek(lines)
File "C:UsersMarcinAppDataLocalProgramsPythonPython37-32libsite-packagesnetworkxreadwritepajek.py", line 205, in parse_pajek
l, nnodes = l.split()
ValueError: too many values to unpack (expected 2)


my code:



import networkx as nx
G = nx.read_pajek("instaedges.net")
print(nx.info(G))


What is the problem here?
I'm using NetworkX 2.2 and python 3.7.0










share|improve this question




















  • 1




    Potentially, "instaedges.net" is not in the correct format. Without the file, this will be impossible to determine though. I would link to the file (put it on github, pastebin or google drive).
    – Paul Brodersen
    Nov 7 at 17:35










  • Yes, it semms that it is indeed the problem. Possibly the conversion of formats was faulty. Thanks!
    – MMis
    Nov 12 at 14:11













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm trying to load a network in pajek format .net into a graph in python. It seems to be an easy task, but I'm getting an error that I don't understand:



Traceback (most recent call last):
File "insta.py", line 4, in <module>
G = nx.read_pajek("instaedges.net")
File "<decorator-gen-588>", line 2, in read_pajek
File "C:UsersMarcinAppDataLocalProgramsPythonPython37-32libsite-packagesnetworkxutilsdecorators.py", line 240, in _open_file
result = func_to_be_decorated(*new_args, **kwargs)
File "C:UsersMarcinAppDataLocalProgramsPythonPython37-32libsite-packagesnetworkxpajek.py", line 163, in read_pajek
return parse_pajek(lines)
File "C:UsersMarcinAppDataLocalProgramsPythonPython37-32libsite-packagesnetworkxreadwritepajek.py", line 205, in parse_pajek
l, nnodes = l.split()
ValueError: too many values to unpack (expected 2)


my code:



import networkx as nx
G = nx.read_pajek("instaedges.net")
print(nx.info(G))


What is the problem here?
I'm using NetworkX 2.2 and python 3.7.0










share|improve this question















I'm trying to load a network in pajek format .net into a graph in python. It seems to be an easy task, but I'm getting an error that I don't understand:



Traceback (most recent call last):
File "insta.py", line 4, in <module>
G = nx.read_pajek("instaedges.net")
File "<decorator-gen-588>", line 2, in read_pajek
File "C:UsersMarcinAppDataLocalProgramsPythonPython37-32libsite-packagesnetworkxutilsdecorators.py", line 240, in _open_file
result = func_to_be_decorated(*new_args, **kwargs)
File "C:UsersMarcinAppDataLocalProgramsPythonPython37-32libsite-packagesnetworkxpajek.py", line 163, in read_pajek
return parse_pajek(lines)
File "C:UsersMarcinAppDataLocalProgramsPythonPython37-32libsite-packagesnetworkxreadwritepajek.py", line 205, in parse_pajek
l, nnodes = l.split()
ValueError: too many values to unpack (expected 2)


my code:



import networkx as nx
G = nx.read_pajek("instaedges.net")
print(nx.info(G))


What is the problem here?
I'm using NetworkX 2.2 and python 3.7.0







python networkx pajek






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 7 at 11:17









Daniel Mesejo

8,1391922




8,1391922










asked Nov 7 at 11:14









MMis

1




1








  • 1




    Potentially, "instaedges.net" is not in the correct format. Without the file, this will be impossible to determine though. I would link to the file (put it on github, pastebin or google drive).
    – Paul Brodersen
    Nov 7 at 17:35










  • Yes, it semms that it is indeed the problem. Possibly the conversion of formats was faulty. Thanks!
    – MMis
    Nov 12 at 14:11














  • 1




    Potentially, "instaedges.net" is not in the correct format. Without the file, this will be impossible to determine though. I would link to the file (put it on github, pastebin or google drive).
    – Paul Brodersen
    Nov 7 at 17:35










  • Yes, it semms that it is indeed the problem. Possibly the conversion of formats was faulty. Thanks!
    – MMis
    Nov 12 at 14:11








1




1




Potentially, "instaedges.net" is not in the correct format. Without the file, this will be impossible to determine though. I would link to the file (put it on github, pastebin or google drive).
– Paul Brodersen
Nov 7 at 17:35




Potentially, "instaedges.net" is not in the correct format. Without the file, this will be impossible to determine though. I would link to the file (put it on github, pastebin or google drive).
– Paul Brodersen
Nov 7 at 17:35












Yes, it semms that it is indeed the problem. Possibly the conversion of formats was faulty. Thanks!
– MMis
Nov 12 at 14:11




Yes, it semms that it is indeed the problem. Possibly the conversion of formats was faulty. Thanks!
– MMis
Nov 12 at 14:11

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53188370%2fnetworkx-error-while-loading-pajek-network%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53188370%2fnetworkx-error-while-loading-pajek-network%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()