About 65,300 results
Open links in new tab
  1. python - Is there a difference between scipy.pi, numpy.pi, or …

    That said, if you're not already using numpy or scipy, importing them just for np.pi or scipy.pi would add unnecessary dependency while math is a Python standard library, so there's no dependency issues when importing it. For example, for pi in Tensorflow code in Python, one could use tf.constant(math.pi).

  2. python - Print pi to a number of decimal places - Stack Overflow

    Mar 6, 2019 · But this still limits n to be less than the len(str(math.pi)), less than 15 in Python 2. Given a serious n , it breaks: > python test.py Enter the number of decimal places you want to see: 100 Traceback (most recent call last): File "test.py", line 10, in <module> length_of_pi.append(str(fraser[places])) IndexError: string index out of range >

  3. Numpy import error Python3 on Raspberry Pi? - Stack Overflow

    Dec 14, 2018 · I had this issue on my Raspberry Pi 4. In my case this was fixed simply by running this in the command line: sudo apt-get install libatlas-base-dev I thought initially I was missing a python module dependency, but this is a unix dependency, its …

  4. python - Numpy converting range of angles from (-Pi, Pi) to (0, …

    May 21, 2016 · Here are several different methods complete with timing: In [1]: import numpy as np; from numpy import linspace, pi In [2]: N=10000 In [3]: %timeit x=linspace(-pi, pi, N); np.where(x<0 , 2*pi+x, x) 10000 loops, best of 3: 79.1 µs per loop In [4]: %timeit x=linspace(-pi, pi, N); np.select(x<0 , 2*pi+x, x) 1 loops, best of 3: 354 ms per loop In [5]: %timeit x=linspace(-pi, pi, N); x[x<0] += 2 ...

  5. python - How do I check which version of NumPy I'm using

    Then when doing the pip list | grep numpy method it will show one of the two (typically the python 3's numpy version). When you run the shownumpy.py program on both python and python 3, they will show you exactly what version is on each respective python environment. –

  6. python - How to downgrade numpy? - Stack Overflow

    Aug 19, 2018 · python -m pip install numpy==x.y.z python will just correspond to python interpreter you are using-m pip will find the right pip that corresponds to your installation of python 2.7; numpy==x.y.z will force the downgrade; Now, you will probably run into permissions problems that will tempt you to use sudo.

  7. python - installing numpy Raspberry Pi - Stack Overflow

    Mar 11, 2019 · I have this problem when i install numpy on Raspberry Pi ( Python 3.6.6 without anaconda): pi@raspberrypi:~/Desktop$ sudo pip3 install numpy pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

  8. python - Raspberry Pi Zero 2 W Numpy Pip Install Fails - Stack …

    Feb 13, 2022 · After a few minutes of waiting, the pi freezes. I waited for 2.5 hours, and the pi didn't unfreeze or finish installing numpy. I am using Python 3.7.3, and I have checked that my pip.conf file contained the line needed to use piwheels as shown in this thread: installing numpy using pip freezing

  9. python - installing numpy using pip freezing - Stack Overflow

    Aug 29, 2019 · The long delay is because numpy is being compiled on your Raspberry Pi. To see what is happening under the hood, you can run pip3 with --verbose. $ pip3 install --verbose numpy==1.17.1 This will give you a better understanding of the problem you are seeing.

  10. Get angle into range 0 - 2*pi - python - Stack Overflow

    Oct 30, 2019 · First, convert to the [-pi, pi] interval using np.arctan2(np.sin(angle), np.cos(angle)). Then, you still need to transform the negative values. Then, you still need to transform the negative values. A final function like this would work:

Refresh