Main namespace
About 100 members of the main np namespace have been deprecated, removed, or moved to a new place. It was done to reduce clutter and establish only one way to access a given attribute. The table below shows members that have been removed:
removed member | migration guideline |
|---|---|
add_docstring | It’s still available as |
add_newdoc | It’s still available as |
add_newdoc_ufunc | It’s an internal function and doesn’t have a replacement. |
alltrue | Use |
asfarray | Use |
byte_bounds | Now it’s available under |
cast | Use |
cfloat | Use |
charrarray | It’s still available as |
clongfloat | Use |
compare_chararrays | It’s still available as |
compat | There’s no replacement, as Python 2 is no longer supported. |
complex_ | Use |
cumproduct | Use |
DataSource | It’s still available as |
deprecate | Emit |
deprecate_with_doc | Emit |
disp | Use your own printing function instead. |
fastCopyAndTranspose | Use |
find_common_type | Use |
format_parser | It’s still available as |
get_array_wrap | |
float_ | Use |
geterrobj | Use the np.errstate context manager instead. |
Inf | Use |
Infinity | Use |
infty | Use |
issctype | Use |
issubclass_ | Use |
issubsctype | Use |
mat | Use |
maximum_sctype | Use a specific dtype instead. You should avoid relying on any implicit mechanism and select the largest dtype of a kind explicitly in the code. |
NaN | Use |
nbytes | Use |
NINF | Use |
NZERO | Use |
longcomplex | Use |
longfloat | Use |
lookfor | Search NumPy’s documentation directly. |
obj2sctype | Use |
PINF | Use |
product | Use |
PZERO | Use |
recfromcsv | Use |
recfromtxt | Use |
round_ | Use |
safe_eval | Use |
sctype2char | Use |
sctypes | Access dtypes explicitly instead. |
seterrobj | Use the np.errstate context manager instead. |
set_numeric_ops | For the general case, use |
set_string_function | Use |
singlecomplex | Use |
string_ | Use |
sometrue | Use |
source | Use |
tracemalloc_domain | It’s now available from |
unicode_ | Use |
who | Use an IDE variable explorer or |
If the table doesn’t contain an item that you were using but was removed in 2.0, then it means it was a private member. You should either use the existing API or, in case it’s infeasible, reach out to us with a request to restore the removed entry.
The next table presents deprecated members, which will be removed in a release after 2.0:
deprecated member | migration guideline |
|---|---|
in1d | Use |
row_stack | Use |
trapz | Use |
Finally, a set of internal enums has been removed. As they weren’t used in downstream libraries we don’t provide any information on how to replace them:
[FLOATING_POINT_SUPPORT, FPE_DIVIDEBYZERO, FPE_INVALID, FPE_OVERFLOW, FPE_UNDERFLOW, UFUNC_BUFSIZE_DEFAULT, UFUNC_PYVALS_NAME, CLIP, WRAP, RAISE, BUFSIZE, ALLOW_THREADS, MAXDIMS, MAY_SHARE_EXACT, MAY_SHARE_BOUNDS]