Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError with division #88

Open
Archerlite opened this issue Aug 7, 2021 · 3 comments
Open

AttributeError with division #88

Archerlite opened this issue Aug 7, 2021 · 3 comments

Comments

@Archerlite
Copy link

Archerlite commented Aug 7, 2021

Hi,

I'm a brand new user on Github and therefore sorry if it is not how I'm expected to use this topic.

Your package seems very useful and I thank you for implementing all of that. However, I'm finding an error when dividing a polynomial by another. Using "/", "%" and "divmod" all end up in an error :
AttributeError: module 'numpy' has no attribute 'broadcast_shapes'

Do you have any idea what in the division functions could end up in such an error ? I tried with elements of the 'numpoly.baseclass.ndpoly' class of different lengths, and none worked. Note that the same error appears when using the symbol "*".

Thank you,
Archer

@jonathf
Copy link
Owner

jonathf commented Aug 8, 2021

No worries.

Can you give me the following info?

  • Python version: python --version
  • Numpy version: python -c "import numpy; print(numpy.__version__)"
  • Numpoly version: python -c "import numpoly; print(numpoly.__version__)"

@Archerlite
Copy link
Author

I'm using Python 3.8, Numpy 1.19, and Numpoly 1.2.3 .

Thank you for answering, I'm really interested in knowing what my mistake can be and how to solve this error. I however found a solution to achieve my program, using the "traditional" functions of Numpy.polynomial with arrays of coefficients rather than Polynomials class. I don't know if this solution I found can help you to understand my mistakes with Numpoly (which I'd really like to use for further projects).

Thanks for your commitment.

@jonathf
Copy link
Owner

jonathf commented Aug 9, 2021

I don't think this is an error you created. Numpoly is dependent on a Numpy function that isn't introduced before 1.20 if I remember correctly.

Run pip install -U numpy and try running your code again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants