Message Boards Message Boards

1
|
996 Views
|
0 Replies
|
1 Total Likes
View groups...
Share
Share this post:

The expression Sqrt[3]/2 could not be encoded as a Python literal expression

Posted 11 months ago

I want to export a list into python format as follows, but failed:

In[106]:= getSGLatt[#]&/@Range[157,158];
(BasicVectors[#]/.{a->1,b->1,c->1, \[Alpha]->Pi/2,\[Beta]->Pi/2,\[Gamma]->Pi/2} // Transpose)&/@%
ExportString[%,"PythonExpression"]

Out[107]= {{{0, Sqrt[3]/2, 0}, {-1, 1/2, 0}, {0, 0, 1}}, {{0, Sqrt[3]/
2, 0}, {-1, 1/2, 0}, {0, 0, 1}}}

During evaluation of In[106]:= Export::invalidpythonexpr: The expression Sqrt[3]/2 could not be encoded as a Python literal expression.

Out[108]= $Failed

How to fix this problem?

Regards, Zhao

POSTED BY: Hongyi Zhao
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract