temp22.sobj is not UTF-8 encoded
I get a temp22.sobj is not UTF-8 encoded after trying to open this file I saved by using save(G.allsimplecycles, 'temp22') what am I doing wrong?
I get a temp22.sobj is not UTF-8 encoded after trying to open this file I saved by using save(G.allsimplecycles, 'temp22') what am I doing wrong?
Having defined A
and G
as follows,
sage: A = Matrix([[0, 1], [1, 0]])
sage: G = DiGraph(A)
we have a directed graph G
, which has a method all_simple_cycles
.
The following only refers to the method itself
sage: G.all_simple_cycles
<bound method DiGraph.all_simple_cycles of Digraph on 2 vertices>
while the following is the result of applying the method to G
.
sage: G.all_simple_cycles()
[[0, 1, 0]]
So if we save the method itself,
sage: save(G.all_simple_cycles, 'temp22')
we can then reload it:
sage: asc = load('temp22')
sage: asc
<bound method ?.all_simple_cycles of Digraph on 2 vertices>
and possibly apply it to G
:
sage: asc(G)
[[0, 1, 0]]
while if we save the result of applying the method to G
,
sage: save(G.all_simple_cycles(), 'temp22')
then reloading it gets us the list of all simple cycles of G:
sage: ascG = load('temp22')
sage: ascG
[[0, 1, 0]]
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2018-04-06 19:33:52 +0100
Seen: 494 times
Last updated: Apr 15 '18
Please provide a reproducible example. Here, we don't have G to try your code.
I am trying to do something alike. This is of course a hazard guess. For me
produces the file,
and then
This is an old linux machine running
Please try to describe in a similar way the problem.
Okay just do A=Matrix([[0,1],[1,0]]) G=Digraph(A)
I'm not sure what save does or where it get's saved to
Please edit your question to provide a complete reproducible example.
To display inline code, like
z = x*y
, use backticks.To display blocks of code or error messages, skip a line above and below, and do one of the following (all give the same result):
For instance, typing
produces:
Please edit your question to do that.