It’s good to know that
but also know that math.log
takes an optional second argument which allows you to specify the base:
In [22]: import math In [23]: math.log? Type: builtin_function_or_method Base Class: <type 'builtin_function_or_method'> String Form: <built-in function log> Namespace: Interactive Docstring: log(x[, base]) -> the logarithm of x to the given base. If the base not specified, returns the natural logarithm (base e) of x. In [25]: math.log(8,2) Out[25]: 3.0
Related Posts:
- Plot logarithmic axes with matplotlib in python
- Understanding the main method of python [duplicate]
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- Python Math – TypeError: ‘NoneType’ object is not subscriptable
- PermissionError: [Errno 13] in Python
- “If not” condition statement in python
- syntaxerror: “unexpected character after line continuation character in python” math
- How can I sort a dictionary by key?
- How do you do natural logs (e.g. “ln()”) with numpy in Python?
- Python Logic of ListNode in Leetcode
- How can I write a `try`/`except` block that catches all exceptions?
- Error in Python script “Expected 2D array, got 1D array instead:”?
- Python Key Error=0 – Can’t find Dict error in code
- Relative imports for the billionth time
- How do I use the yfinance API in Python to get today’s DJI open?
- what does the __file__ variable mean/do?
- Pythonic way to create a long multi-line string
- Proper shebang for Python script
- ‘str’ object has no attribute ‘decode’. Python 3 error?
- How do I correctly clean up a Python object?
- Implement touch using Python?
- Python setup.py develop vs install
- How to clamp an integer to some range?
- How to extract the substring between two markers?
- Is there an operation for not less than or not greater than in python?
- Simple prime number generator in Python
- Background color for Tk in Python
- If Python is interpreted, what are .pyc files?
- How do I get monitor resolution in Python?
- What is runtime in context of Python? What does it consist of?
- Unable to convert 3d ply file image to 2d image
- Python High Pass Filter
- Where are the ampersand and vertical bar characters used in Python?
- Python: What OS am I running on?
- How to draw a line with matplotlib?
- What is the maximum float in Python?
- Get all object attributes in Python?
- Normalizing a list of numbers in Python
- mport win32ui in python 3.6
- Writing a pandas DataFrame to CSV file
- deleting file if it exists; python
- Python Linked List
- How to print without a newline or space
- Create blank image in Imagemagick
- Error: ‘int’ object is not subscriptable – Python
- Does Python have a ternary conditional operator?
- How do I install opencv using pip?
- How do I compare two strings in python?
- Purpose of “%matplotlib inline”
- Curve curvature in numpy
- How do I update Anaconda?
- How do I upgrade to Python 3.6 with conda?
- Can’t fix “zipimport.ZipImportError: can’t decompress data; zlib not available” when I type in “python3.6 get-pip.py”
- Arrays used as indices must be of integer (or boolean) type
- python pip – install from local dir
- Regex lookahead, lookbehind and atomic groups
- Are static class variables possible in Python?
- Why am I getting “LinAlgError: Singular matrix” from grangercausalitytests?
- MIPS fetch address not aligned on word boundary, used .align 4, still no go
- Python can’t find my module
- How to determine a Python variable’s type?
- Could not find a version that satisfies the requirement
- Removing Conda environment
- PHP password_hash(), password_verify()
- Find how many connected groups of nodes in a given adjacency matrix
- What does `<>` mean in Python?
- Uncaught TypeError: Cannot read property ‘style’ of null – JS error
- Add a new item to a dictionary in Python
- reducing number of plot ticks
- How can I add new keys to a dictionary?
- Convert pandas data frame to series
- SettingWithCopyWarning even when using .loc[row_indexer,col_indexer] = value
- jQuery preventDefault() not triggered
- Append a tuple to a list – what’s the difference between two ways?
- No module named Image
- How to fix “TypeError: len() of unsized object”
- Python data structure sort list alphabetically
- Different meanings of brackets in Python
- repaint() Method in Java
- TypeError: ‘numpy.float64’ object does not support item assignment
- Python/Django: log to console under runserver, log to file under Apache
- TypeError: unsupported format string passed to list.__format__
- Getting “socket.error: [Errno 61] Connection refused” python paramiko
- How often does python flush to a file?
- git push –force-with-lease vs. –force
- How to open every file in a folder
- Python iteration over non-sequence
- How do I convert a string to a double in Python?
- _csv.Error: field larger than field limit (131072)
- Spell Checker for Python
- TypeError: coercing to Unicode: need string or buffer, int found
- Paramiko’s SSHClient with SFTP
- Package libffi was not found in the pkg-config search path REDHAT6.5
- Line is too long. Django PEP8
- TypeError: zip argument #2 must support iteration
- CS231n: How to calculate gradient for Softmax loss function?
- How to create a new database using SQLAlchemy?
- WordPress localization
- Password protected Profile View