About 327,000 results
Open links in new tab
  1. math - Calculate logarithm in Python - Stack Overflow

    Nov 17, 2015 · I am wondering why the result of log base 10 (1.5) in Python is 0.405465108108, while the real answer is 0.176091259. This is the code that I wrote: import math print …

  2. python - Plot logarithmic axes - Stack Overflow

    Nov 26, 2023 · You can use the Axes.set_yscale method. That allows you to change the scale after the Axes object is created. That would also allow you to build a control to let the user pick …

  3. logarithm - Log to the base 2 in python - Stack Overflow

    Sep 15, 2010 · Using numpy: In [1]: import numpy as np In [2]: np.log2? Type: function Base Class: <type 'function'> String Form: <function log2 at 0x03049030> Namespace: Interactive …

  4. How do you do natural logs (e.g. "ln()") with numpy in Python?

    Numpy seems to take a cue from MATLAB/Octave and uses log to be "log base e" or ln. Also like MATLAB/Octave, Numpy does not offer a logarithmic function for an arbitrary base. If you find …

  5. python - Using logging in multiple modules - Stack Overflow

    I have a small python project that has the following structure - Project -- pkg01 -- test01.py -- pkg02 -- test02.py -- logging.conf I plan to use the default logging module to print me...

  6. How should logging be used in a Python package?

    Nov 19, 2014 · and developers using your library can then disable all logging just for your library by disabling log propagation: logging.getLogger('name.of.library').propagate = False All this is …

  7. How to log python exception? - Stack Overflow

    May 8, 2017 · The first argument to logging.exception isn't for the exception to log (Python just grabs the one from the current except: block by magic), it's for the message to log before the …

  8. How to write to a file, using the logging Python module?

    Jun 17, 2011 · The code example @EliBendersky has written is missing 1 step if you want to write info / debug msgs. The logger itself needs its own log level to be configured to accept that …

  9. ln (Natural Log) in Python - Stack Overflow

    In this assignment I have completed all the problems except this one. I have to create a python script to solve an equation (screenshot). Unfortunately, in my research all over the internet I …

  10. Get logarithm without math log python - Stack Overflow

    Jan 16, 2023 · def my_log(x, base): count = -1 while x > 0: x /= base count += 1 if x == 0: return count print my_log(16, 2) # %timeit %run my_log.py # 1000 loops, best of 3: 321 us per loop …

Refresh