f



AttributeError: 'Or' object has no attribute 'as_independent'

Traceback (most recent call last):
  File "testcsv.py", line 17, in <module>
    print(sy.solve([x^2+x+1-t, x^3+x^2-t], x))
  File "C:\Python27\lib\site-packages\sympy\solvers\solvers.py", line 902, in so
lve
    solution = _solve_system(f, symbols, **flags)
  File "C:\Python27\lib\site-packages\sympy\solvers\solvers.py", line 1434, in _
solve_system
    i, d = _invert(g, *symbols)
  File "C:\Python27\lib\site-packages\sympy\solvers\solvers.py", line 2422, in _
invert
    indep, dep = lhs.as_independent(*symbols)
AttributeError: 'Or' object has no attribute 'as_independent'


Code:

import csv as csv
import os
import numpy as np
import sympy as sy
#from sympy import solve, Poly, Eq, Function, exp
from sympy import *
from numpy import *
from numpy.linalg import *
from sympy.polys.polyfuncs import interpolate
from sympy import Function, dsolve, Eq, Derivative, sin, cos
from sympy.abc import x

f = sy.Function('f')
x = sy.Symbol("x")
t = sy.Symbol("t")

print(sy.solve([x^2+x+1-t, x^3+x^2-t], x))
print(sy.solve((x^2+x+1-t, x^3+x^2-t), x))


0
wilsonmonde
2/13/2014 9:03:43 AM
comp.lang.python 77058 articles. 6 followers. Post Follow

1 Replies
719 Views

Similar Articles

[PageSpeed] 7

On 2/13/2014 4:03 AM, wilsonmonde@gmail.com wrote:
> Traceback (most recent call last):
>    File "testcsv.py", line 17, in <module>
>      print(sy.solve([x^2+x+1-t, x^3+x^2-t], x))
>    File "C:\Python27\lib\site-packages\sympy\solvers\solvers.py", line 902, in so
> lve
>      solution = _solve_system(f, symbols, **flags)
>    File "C:\Python27\lib\site-packages\sympy\solvers\solvers.py", line 1434, in _
> solve_system
>      i, d = _invert(g, *symbols)
>    File "C:\Python27\lib\site-packages\sympy\solvers\solvers.py", line 2422, in _
> invert
>      indep, dep = lhs.as_independent(*symbols)
> AttributeError: 'Or' object has no attribute 'as_independent'

You should report this on the sympy list. It is mirrored on 
news.gmane.org as gmane,comp.python.sympy.

> Code:
>
> import csv as csv
> import os
> import numpy as np
> import sympy as sy
> #from sympy import solve, Poly, Eq, Function, exp
> from sympy import *
> from numpy import *
> from numpy.linalg import *
> from sympy.polys.polyfuncs import interpolate
> from sympy import Function, dsolve, Eq, Derivative, sin, cos
> from sympy.abc import x
>
> f = sy.Function('f')
> x = sy.Symbol("x")
> t = sy.Symbol("t")
>
> print(sy.solve([x^2+x+1-t, x^3+x^2-t], x))
> print(sy.solve((x^2+x+1-t, x^3+x^2-t), x))
>
>


-- 
Terry Jan Reedy

0
Terry
2/13/2014 12:31:17 PM
Reply:

Similar Artilces:

AttributeError: ' ' object has no attribute ' '
I am using Ubuntu 12.10, and Python 2.7.3, GNU Radio Companion v3.6.3. I get the this error in terminal: in __init__ self.wxgui_waterfallsink2_0.set_callback(wxgui_waterfallsink2_0_callback) File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", line 54, in __getattr__ return getattr(self._hb, name) AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback' I have been getting this error in multiple programs. So what is stopping the program here? There is no Attribute .set_callback obviously. But where is t...

'is not' or '!='
A newbie question to you; what is the difference between statements like: if x is not None: and if x != None: Without any context, which one should be preferred? IMHO, the latter is more readable. On 2014-08-18 21:35, ElChino wrote: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: > > Without any context, which one should be preferred? > IMHO, the latter is more readable. > "x == y" tells you whether x and y refer to objects that are equal. "x is y" tells you whether x and y actually refer to the same object. In the case of singletons like None (there's only one None object), it's better to use "is". "ElChino" <elchino@cnn.cn>: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: Do the following: take two $10 bills. Hold one bill in the left hand, hold the other bill in the right hand. Now, the bill in the left hand "is not" the bill in the right hand. However, the bill in the left hand "==" the bill in the right hand. > Without any context, which one should be preferred? > IMHO, the latter is more readable. In almost all cases, both tests would result in the same behavior. However, the "is not" test is conceptually the correct one since you want...

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

AttributeError: 'Attributes' object has no attribute 'saveFile'
Not sure how to explain, but I'll try my best. I'm making a GUI with wxGlade. The GUI has windows that open when the "Next Page" button is pushed; the button also pickles the information that is input into the frame at the same time. The saveFile name is autocreated based on the data entered by the user in the first frame. Each frame that is created is a new class, e.g. the first frame that opens is "CharInfo", which opens the frame "Attributes". The pickling works for the first frame but doesn't work for the ones after. Apparently the saveFile at...

PyKota, Python: AttributeError: 'module' object has no attribute '_quote'
Hello everyone, I'm new to linux/suse, but I was given the task to install the print accounting software PyKota. Before that I never even touched a linux system, so I don't have any basic knowlegde at all! Up to now I was able to solve all problems with the help of google, but now I'm stuck. My problem: linux-6n5c:/usr/local/bin # pkusers --add john paul Creation... ERROR: PyKota v1.26_official ERROR: pkusers failed ERROR: Traceback (most recent call last): ERROR: File "/usr/local/bin/pkusers", line 442, in <module> ERROR: retco...

python+libxml2+scrapy AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER'
Hello. Has anybody already meet the problem like this? - AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER' When I run scrapy, I get File "/usr/local/lib/python2.7/site-packages/scrapy/selector/factories.py", line 14, in <module> libxml2.HTML_PARSE_NOERROR + \ AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER' When I run python -c 'import libxml2; libxml2.HTML_PARSE_RECOVER' I get Traceback (most recent call last): File "<string>", line 1, in <module...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal''''''''''''''
Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i am using is; _____________________________________________________ SELECT "criteria" FROM "criteria" WHERE "criteria" UPDATE/APPEND "field selections" RecordSource "qryExample" = above text strings" _______________________________________________________________________ When i am running a SELECT query in this manner it works fine with no problems, and accepts the values of specified linked for...

AttributeError: 'module' object has no attribute 'setdefaulttimeout'
I get those errors when I run: /usr/local/bin/SquidClamAV_Redirector.py -c /etc/squid/SquidClamAV_Redirector.conf ################## Traceback (most recent call last): File "/usr/local/bin/SquidClamAV_Redirector.py", line 573, in ? redirector = SquidClamAV_Redirector(config) File "/usr/local/bin/SquidClamAV_Redirector.py", line 145, in __init__ self.__start_urlhandler__() File "/usr/local/bin/SquidClamAV_Redirector.py", line 454, in __start_urlhandler__ urllib.socket.setdefaulttimeout(self.timeout) AttributeError: 'module' object has no attribute 'setdefaulttimeout' ################# the line that is the problem looks like this: ############# urllib.socket.setdefaulttimeout(self.timeout) ############# from the global sintax: ############## def __start_urlhandler__(self): """ create the urlhandler object """ # set timeout urllib.socket.setdefaulttimeout(self.timeout) self.urlhandler = urllib.URLopener() if self.proxy != {}: self.urlhandler.proxies = self.proxy self.urlhandler.addheaders = [('User-agent', ModuleName + ' ' + str(version))] ############## can you give me a hint with this matter? adrian wrote: > urllib.socket.setdefaulttimeout(self.timeout) > AttributeError: 'module' object has no attribute 'setdef...

AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback'
------=_Part_1122770_31157900.1360876583037 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit I am using ubuntu 12.10 and python version 2.7.3. i run the following command in terminal: matt@matt-Inspiron-1525:~$ python -m trace --count -C . op25_grc.py Here is the output with an error: Imported legacy fsk4 Using Volk machine: ssse3_32 Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _...

AttributeError: 'module' object has no attribute 'letters'
what does this error mean? i am trying to use mark hammonds win32 package. Traceback (most recent call last): File "aui2.py", line 11, in <module> import win32com.client File "C:\Python25\lib\site-packages\win32com\client\__init__.py", line 12, in <module> import dynamic, gencache, pythoncom File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 24, in <module> import build File "C:\Python25\lib\site-packages\win32com\client\build.py", line 507, in <module> valid_identifier_chars = string.le...

AttributeError: 'function' object has no attribute 'split'
PathList= string.split(FullPath, "/") is generating the above error message. when I run my script, but works just fine from the python command line! What gives? "Earl" <eee@nmt.edu> wrote in message news:11e5f362.0405060845.16fff0f8@posting.google.com... > PathList= string.split(FullPath, "/") is generating the above error > message. when I run my script, but works just fine from the python > command line! What gives? Somehow you've bound the name "string" to a function e.g. >>> def string(): .... return 'help' ...

AttributeError: 'module' object has no attribute 'HTTPSHandler'
Hi I built and installed python 2.5 from source and when I do this: opener = urllib2.build_opener(SmartRedirectHandler(), DefaultErrorHandler(), urllib2.HTTPSHandler()) I get this error. AttributeError: 'module' object has no attribute 'HTTPSHandler' What should I do? ...

AttributeError: 'list' object has no attribute 'lower'
On page 77 of the book natural language processing with Python, we have such an exercise: The polysemy of a word is the number of senses it has. Using WordNet, we can determine that the noun doghas seven senses with len(wn.synsets('dog', 'n')). Compute the average polysemy of nouns, verbs, adjectives, and adverbs according to WordNet.http://nltk.googlecode.com/svn/trunk/doc/book/ch02.html I wrote the following function to solve it. However, it pops up "AttributeError: 'list' object has no attribute 'lower'". Quite confused, I supposed [synset.lemm...

AttributeError: 'module' object has no attribute 'fork'
Hi, Code: import os, time def child(pipeout): zzz = 0 while True: time.sleep(zzz) msg = ('Spam %03d' % zzz).encode() os.write(pipeout, msg) zzz = (zzz+1) % 5 def parent(): pipein, pipeout = os.pipe() if os.fork() == 0: child(pipeout) else: while True: line = os.read(pipein, 32) print('Parent %d got [%s] at %s' % (os.getpid(), line, time.time())) parent() Output: Traceback (most recent call last): File "C:/Python34/pipe1.py", line 17, in <module>...

AttributeError: 'module' object has no attribute '__path__'
I am using Jupyter notebooks, with Python 3.4. The error below references t= he Anaconda distribution package. This error occurred quite precipitously (= only 2 minutes before I was able to import the modules). I am using Windows= 7. My path in the console uses Python27. I also have python 34 as well. I = am not sure where to start modifying the path and fear that I will break my= initial setup. I welcome feedback on next steps. --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) ...

AttributeError: 'module' object has no attribute 'urlopen'
Hey, I am trying to run the following example from diveintopython import urllib sock = urllib.urlopen("http://diveintopython.org/") htmlSource = sock.read() sock.close() print htmlSource I have Python 2.3.3 but when i run the above code I get the following error: raceback (most recent call last): File "urllib.py", line 1, in ? import urllib File "/home/shalen/programming/python/tutorials/py/urllib.py", line 2, in ? sock = urllib.urlopen("http://diveintopython.org/") AttributeError: 'module' object has no attribute 'urlopen' Anyone knows how to fix this and why I am getting this error? Thanks Dont ~ ~ ~ ~ __________________________________ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools dont bother wrote: > import urllib > sock = urllib.urlopen("http://diveintopython.org/") > htmlSource = sock.read() > sock.close() > print htmlSource > > I have Python 2.3.3 but when i run the above code I > get the following error: > > raceback (most recent call last): > File "urllib.py", line 1, in ? > import urllib > File > "/home/shalen/programming/python/tutorials/py/urllib.py", > line 2, in ? > sock = > urllib.urlopen("http://diveintopython.org/") > AttributeError: 'module' object has no attribute > 'urlopen' > This is a name cl...

AttributeError: 'module' object has no attribute 'pack'
Dear List, I have a freshly installed opensuse 11.2 and I am experiencing the following problem with the module "subprocess": sampsa@linux-912g:~> python Python 2.6 (r26:66714, Feb 3 2009, 20:52:03) [GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/subprocess.py", line 404, in <module> import p...

AttributeError: 'tuple' object has no attribute 'encode'
Hi, I'm trying to build a SQL string sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", (cid, ag, self.data[parent][child]['results']['test']) It raises this error: AttributeError: 'tuple' object has no attribute 'encode' Some of the variables are unicode (test and ag) - is that what is causing this error? What do I need to do to make it work? Thanks! Erik On Apr 5, 10:31 am, "erikcw" <erikwickst...@gmail.com> wrote: > Hi, > > I'm trying to build a SQ...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal'''''''''''''' #2
Hi, Thanks for ur help there HJ. I know how to do the tasks you specified there. I would like for the update query to use field values from some of the fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, DateTo. My problem is that an append/update query can't find the values in the open Form (frmInvoices) when I specify them as; [Forms]![frmInvoices]![InvoiceNumber] a select query has no problem finding the field values on a form. please help. Aaron Hi Aaron, Could you post the entire code that you are having trouble with? Now it is not possible to see what goes wrong. HJ "Aaron" <aaron@rapid-motion.co.uk> wrote in message news:260d7f40.0408120245.2f3d01f8@posting.google.com... > Hi, > > Thanks for ur help there HJ. > > I know how to do the tasks you specified there. > > I would like for the update query to use field values from some of the > fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, > DateTo. My problem is that an append/update query can't find the > values in the open Form (frmInvoices) when I specify them as; > > [Forms]![frmInvoices]![InvoiceNumber] > > a select query has no problem finding the field values on a form. > > please help. > > Aaron First off, if you are not always using all the parameters specified in your form, then you have to add parameters to your query on the fly. Also, you can't just do something like qdf.SQL = "SE...

if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ?
Hi, there. =20 I'm just curious if it ever dawned on anybody how to abbreviate this line : if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.')=20 =20 Igor Kurbeko Clinical Programmer Analyst 678 336 4328 ikurbeko@atherogenics.com =20 no brain no pain =20 how about: if not (str_mo in ('','.') or str_da in ('','.') or str_yy in ('','.')) OR if not (missing(str_mo) or missing(str_da) or missing(str_yy)) Eric On 22 Oct 03 21:13:37 GMT, ikurbeko@ATHER...

logging: AttributeError: 'module' object has no attribute 'getLogger'
Hi all: Being completely new to Python still (just about a week into it now) I tried to follow the Python 2.6.5 version documemtation aiming at setting up a logger as follows: <code> import logging global gPIBLogger class PIBLogger(object): ''' TODO: classdocs ''' def __init__(self, logFileName): ''' Constructor ''' self.logFileName = logFileName self.logger = logging.getLogger('PIBLogger') self.logger.setLevel(logging.DEBUG) hand...

M2Crypto: AttributeError: 'CSR' object has no attribute 'pkey'
Hello python-guys I am trying to build a python based certificate authority using m2crypto. I am quite new to python and I am asking myself why my code snippets below throw the following Traceback: $ python csr.py ....++++++++++++ ................++++++++++++ Traceback (most recent call last): File "csr.py", line 48, in <module> csr.create_cert_signing_request(pubkey, cert_name) File "csr.py", line 17, in create_cert_signing_request cert_request.set_pubkey(keypair) File "/usr/lib64/python2.6/site-packages/M2Crypto/X509.py", line 926, in set_...

A function with 'and' , 'not' , 'null' , 'car' and 'cdr'
What's this ? (defun enigma (x) (and (not (null x)) (or (null (car x)) (enigma (cdr x))))) "I suppose I should learn Lisp, but it seems so foreign." - Paul Graham, Nov 1983 On Wed, Oct 07 2015, CAI GENGYANG wrote: > What's this ? > > > (defun enigma (x) > (and (not (null x)) > (or (null (car x)) > (enigma (cdr x))))) Bad taste? It returns T if the list X contains nil as an element. It would be clearer to write (some #'null x). Helmut CAI GENGYANG ...

which is more 'pythonic' / 'better' ?
hi, there are 2 versions of a simple code. which is preferred? === if len(line) >= (n+1): text = line[n] else: text = 'nothing' === === try: text = line[n] except IndexError: text = 'nothing' === which is the one you would use? thanks, gabor gabor wrote: > hi, > > there are 2 versions of a simple code. > which is preferred? > > > === > if len(line) >= (n+1): > text = line[n] > else: > text = 'nothing' > === > > > === > try: > text = line[n] > except IndexError: > text = '...

Web resources about - AttributeError: 'Or' object has no attribute 'as_independent' - comp.lang.python

Resources last updated: 3/6/2016 11:55:39 AM