About 191,000 results
Open links in new tab
  1. Is there a short-hand for nth root of x in Python? - Stack Overflow

    144 nth root of x is x^(1/n), so you can do 9**(1/2) to find the 2nd root of 9, for example. In general, you can compute the nth root of x as: x**(1/n) Note: In Python 2, you had to do …

  2. How do I calculate square root in Python? - Stack Overflow

    Jan 20, 2022 · Python sqrt limit for very large numbers? square root of a number greater than 10^2000 in Python 3 Which is faster in Python: x**.5 or math.sqrt (x)? Why does Python give …

  3. How do I change the working directory in Python? - Stack Overflow

    Jan 10, 2009 · While os.chdir won't change the parent directory, you should note that in some contexts, you can make an alias that uses cd to simulate a script that changes the directory it …

  4. math - Integer square root in python - Stack Overflow

    Mar 13, 2013 · Is there an integer square root somewhere in python, or in standard libraries? I want it to be exact (i.e. return an integer), and raise an exception if the input isn't a perfect …

  5. python: Change the scripts working directory to the script's own ...

    This will change your current working directory to so that opening relative paths will work: import os os.chdir("/home/udi/foo") However, you asked how to change into whatever directory your …

  6. How to perform square root without using math module?

    Jun 15, 2010 · I want to find the square root of a number without using the math module,as i need to call the function some 20k times and dont want to slow down the execution by linking to the …

  7. performance - Which is faster in Python: x**.5 or math.sqrt (x ...

    There are at least 3 ways to do a square root in Python: math.sqrt, the '**' operator and pow (x,.5). I'm just curious as to the differences in the implementation of each of these. When it comes to …

  8. python - Applying sqrt function on a column - Stack Overflow

    May 16, 2016 · Just use numpy.sqrt() (see docs) on the resulting pd.Series: import numpy as np np.sqrt(football[['wins', 'losses']].sum(axis=1)) But there are of course several ways to …

  9. python - What is the most efficient way of doing square root of …

    Jun 28, 2018 · I am looking for the more efficient and shortest way of performing the square root of a sum of squares of two or more numbers. I am actually using numpy and this code: …

  10. How To Find The sqrt Of A Negative Number In Python

    Oct 3, 2019 · How To Find The sqrt Of A Negative Number In Python Asked 5 years, 9 months ago Modified 5 years, 9 months ago Viewed 1k times