title: input text file (a double quoted string w/ %e %i sqrt z1 z2 log) into sympy or numpy or scipy for a Laurent series
body: <p>Lengthy title, but I thought it might be best to be very informative...</p>
  
  <p>I have very long expressions using symbols such as %i, %e, log, z1 and z2, that is sandwiched in between double quotes, e.g. something like,</p>
  
  <pre><code>"(4*z1*z2*%e^(z2^2+z1^2)*((%e^z1^2-%e^z2^2)^2*(96*%e^(13*(((-(202907687053026635*%i*sqrt(1037*sqrt(23)*%i+1463)*(log(9)*sqrt(2)*sqrt(7)*sqrt(1037*sqrt(23)*%i+....."X
  </code></pre>
  
  <p>(where when viewing the file in a hex editor, the last X is not an X but a hexadecimal 0A - whatever that is - don't think looking it up on an ascii chart will shed much light on it)</p>
  
  <p>I'd like to try out the python/sympy/numpy/scipy/... amalgamations in lieu of other CAS-capable software, but I am having no luck finding out how to do this, at least from a consistent "package". I see snippets from a tutorial on scipy, or a snippet from numpy, etc.</p>
  
  <p>I would like to take the Laurent series of an expression like above - it is exact expression devoid of floats.</p>
  
  <p>Hope this is easy to understand request,</p>
  
  <p>Best wishes.</p>
  
  <p><strong>edit - update Python to 3.6 - still AttributeError</strong></p>
  
  <p>So I saw some errors in converting the symbols exp, etc. into an acceptable string. This seems to work better <em>but</em> "ex" is still not being treated as a <em>Sympy expression</em> after sympify:</p>
  
  <pre><code>(py3_kernel) sbh@sbh-MacBookPro ~ $ ipython
  Python 3.6.3 (default, Oct  6 2017, 08:44:35) 
  Type 'copyright', 'credits' or 'license' for more information
  IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
  
  In [1]: import sympy as s
  
  In [2]: import numpy as np
  
  In [3]: from numpy import *
  
  In [4]: from sympy import *
  
  In [5]: from sympy.utilities.lambdify import lambdify, implemented_function, lambdastr
  
  In [6]: with open('c.txt', 'r') as myfile:
     ...:     d=myfile.read().replace('\n', '').replace('%i','I').replace('%e','exp').replace('^','**
     ...: ').replace('exp**','exp')
     ...:     
  
  In [7]: d
  Out[7]: '"(4*z1*z2*exp(z2**2+z1**2)*sqrt(1037*sqrt(23)*I+1463))+log(1/2)+(sqrt(-I)*z1)/(sqrt(3)*23**(1/4))"'
  
  In [8]: z1,z2 = s.symbols('z1,z2', real=True)
  
  In [9]: ex = s.sympify(d)
  
  In [10]: ex
  Out[10]: '(4*z1*z2*exp(z2**2+z1**2)*sqrt(1037*sqrt(23)*I+1463))+log(1/2)+(sqrt(-I)*z1)/(sqrt(3)*23**(1/4))'
  
  In [11]: type(ex)
  Out[11]: str
  
  In [12]: ex.subs({z1:0, z2:1})
  ---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-12-63eab202c7b1&gt; in &lt;module&gt;()
  ----&gt; 1 ex.subs({z1:0, z2:1})
  
  AttributeError: 'str' object has no attribute 'subs'
  </code></pre>