A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.scipy.org/doc/numpy/reference/generated/numpy.base_repr.html below:

numpy.base_repr — NumPy v2.3 Manual

numpy.base_repr#
numpy.base_repr(number, base=2, padding=0)[source]#

Return a string representation of a number in the given base system.

Parameters:
numberint

The value to convert. Positive and negative values are handled.

baseint, optional

Convert number to the base number system. The valid range is 2-36, the default value is 2.

paddingint, optional

Number of zeros padded on the left. Default is 0 (no padding).

Returns:
outstr

String representation of number in base system.

Examples

>>> import numpy as np
>>> np.base_repr(5)
'101'
>>> np.base_repr(6, 5)
'11'
>>> np.base_repr(7, base=5, padding=3)
'00012'
>>> np.base_repr(10, base=16)
'A'
>>> np.base_repr(32, base=16)
'20'

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4