8000 API: Cleaning `numpy/__init__.py` and main namespace - Part 5 [NEP 52] by mtsokol · Pull Request #24587 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

API: Cleaning numpy/__init__.py and main namespace - Part 5 [NEP 52] #24587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
API: Remove chararray, compare_chararrays, recarray and format_parser…
… from main namespace
  • Loading branch information
mtsokol committed Sep 17, 2023
commit 2391866e421a97b1f28d0221100aa5f037344857
4 changes: 2 additions & 2 deletions doc/source/reference/arrays.classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -494,13 +494,13 @@ executing them on an element-by-element basis. Perhaps the easiest
way to create a chararray is to use :meth:`self.view(chararray)
<ndarray.view>` where *self* is an ndarray of str or unicode
data-type. However, a chararray can also be created using the
:meth:`numpy.chararray` constructor, or via the
:meth:`numpy.char.chararray` constructor, or via the
:func:`numpy.char.array <core.defchararray.array>` function:

.. autosummary::
:toctree: generated/

chararray
char.chararray
core.defchararray.array

Another difference with the standard ndarray of str data-type is
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/routines.dtype.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Creating data types
:toctree: generated/

dtype
format_parser
rec.format_parser

Data type information
---------------------
Expand Down
6 changes: 3 additions & 3 deletions doc/source/user/basics.rec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -673,13 +673,13 @@ appropriate `view <numpy-ndarray-view>`_::
>>> arr = np.array([(1, 2., 'Hello'), (2, 3., "World")],
... dtype=[('foo', 'i4'),('bar', 'f4'), ('baz', 'a10')])
>>> recordarr = arr.view(dtype=np.dtype((np.record, arr.dtype)),
... type=np.recarray)
... type=np.rec.recarray)

For convenience, viewing an ndarray as type :class:`numpy.recarray` will
For convenience, viewing an ndarray as type :class:`numpy.rec.recarray` will
automatically convert to :class:`numpy.record` datatype, so the dtype can be left
out of the view::

>>> recordarr = arr.view(np.recarray)
>>> recordarr = arr.view(np.rec.recarray)
>>> recordarr.dtype
dtype((numpy.record, [('foo', '<i4'), ('bar', '<f4'), ('baz', 'S10')]))

Expand Down
8 changes: 4 additions & 4 deletions numpy/__init__.py
9E74
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@
atleast_1d, atleast_2d, atleast_3d, base_repr, binary_repr,
bitwise_and, bitwise_not, bitwise_or, bitwise_xor, block, bool_,
broadcast, busday_count, busday_offset, busdaycalendar, byte, bytes_,
can_cast, cbrt, cdouble, ceil, char, character, chararray,
choose, clip, clongdouble, compare_chararrays,
can_cast, cbrt, cdouble, ceil, char, character,
choose, clip, clongdouble,
complexfloating, compress, concatenate, conj, conjugate, convolve,
copysign, copyto, correlate, cos, cosh, count_nonzero, cross, csingle,
cumprod, cumproduct, cumsum, datetime64, datetime_as_string,
Expand All @@ -139,7 +139,7 @@
errstate, euler_gamma, exp, exp2, expm1, fabs,
flatiter, flatnonzero, flexible, sctypeDict,
float_power, floating, floor, floor_divide, fmax, fmin, fmod,
format_float_positional, format_float_scientific, format_parser,
format_float_positional, format_float_scientific,
frexp, from_dlpack, frombuffer, fromfile, fromfunction, fromiter,
frompyfunc, fromstring, full, full_like, gcd, generic, geomspace,
get_printoptions, getbufsize, geterr, geterrcall, greater,
Expand All @@ -156,7 +156,7 @@
negative, nested_iters, newaxis, nextafter, nonzero, not_equal,
number, object_, ones, ones_like, outer, partition,
pi, positive, power, printoptions, prod, product, promote_types,
ptp, put, putmask, rad2deg, radians, ravel, rec, recarray, reciprocal,
ptp, put, putmask, rad2deg, radians, ravel, rec, reciprocal,
record, remainder, repeat, require, reshape, resize, result_type,
right_shift, rint, roll, rollaxis, round,
searchsorted, set_printoptions,
Expand Down
Loading
0