About 207,000 results
Open links in new tab
  1. Is there a difference between scipy.pi, numpy.pi, or math.pi?

    Sep 8, 2023 · All other things being equal, I would use math.pi simply because it is in the standard library if the module doesn't depend on numpy or scipy otherwise -- But as you say, use pi in …

  2. python - ImportError: No module named 'board' (AdaFruit ... - Stack ...

    Nov 7, 2018 · I run the setup from this website to get my arduino to use AdaFruit LEDs. And also run: sudo pip3 install adafruit-circuitpython-neopixel I then made this python code: import board import …

  3. python - Error: cannot import name 'pi' - Stack Overflow

    Jun 13, 2016 · >>> from math import pi >>> pi 3.141592653589793 Check whether you have another module named math by typing pip freeze in terminal, or check if you have a python file named …

  4. Using PI in python 2.7 - Stack Overflow

    Jan 8, 2016 · I am trying to access the value of pi in Python 2.7, but it seems as if Python doesn't recognize math.pi. I am using IDLE, and when I try to print the value of math.pi, it says that "Math is …

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

    Mar 6, 2019 · Is the challenge to print pi rounded to n decimal digits, or print the first n decimal digits of pi?

  6. python - What exactly does "import *" import? - Stack Overflow

    Mar 2, 2010 · In Python, what exactly does import * import? Does it import __init__.py found in the containing folder? For example, is it necessary to declare from project.model import __init__, or is …

  7. 1000 digits of pi in Python - Stack Overflow

    try: # import version included with old SymPy from sympy.mpmath import mp except ImportError: # import newer version from mpmath import mp mp.dps = 1000 # set number of digits print(mp.pi) # …

  8. python - unable to import module serial - Stack Overflow

    Feb 27, 2023 · I'm getting the following for a script on my Raspberry Pi: import serial ImportError: No module named serial while the module is already installed with pip: $ pip install pyserial Looking in i...

  9. python - Raspberry Pi Pico and error message "ImportError: no module ...

    Mar 21, 2022 · from machine import Pin import time led = Pin(13, Pin.OUT) while True: led(1) time.sleep(1) led(0) time.sleep(1) When I run it though, it gives this error: Traceback (most recent call …

  10. Python - Writing a function to calculate and return the area of a ...

    Jan 10, 2014 · import math def calculate_area(radius): return math.pi * radius ** 2 Note that your function doesn't use or need a myarea argument either. I also renamed the function; since your …