mirror of
https://github.com/boostorg/python.git
synced 2026-01-24 06:02:14 +00:00
@@ -79,6 +79,9 @@ public:
|
||||
|
||||
/// @brief Return a view of the scalar with the given dtype.
|
||||
ndarray view(dtype const & dt) const;
|
||||
|
||||
/// @brief Copy the array, cast to a specified type.
|
||||
ndarray astype(dtype const & dt) const;
|
||||
|
||||
/// @brief Copy the scalar (deep for all non-object fields).
|
||||
ndarray copy() const;
|
||||
|
||||
@@ -37,6 +37,7 @@ synopsis
|
||||
};
|
||||
|
||||
ndarray view(dtype const & dt) const;
|
||||
ndarray astype(dtype const & dt) const;
|
||||
ndarray copy() const;
|
||||
int const shape(int n) const;
|
||||
int const strides(int n) const;
|
||||
@@ -92,6 +93,12 @@ constructors
|
||||
|
||||
:Returns: new ndarray with old ndarray data cast as supplied dtype
|
||||
|
||||
::
|
||||
|
||||
ndarray astype(dtype const & dt) const;
|
||||
|
||||
:Returns: new ndarray with old ndarray data converted to supplied dtype
|
||||
|
||||
::
|
||||
|
||||
ndarray copy() const;
|
||||
|
||||
@@ -146,6 +146,12 @@ ndarray ndarray::view(dtype const & dt) const
|
||||
return ndarray(python::detail::new_reference
|
||||
(PyObject_CallMethod(this->ptr(), const_cast<char*>("view"), const_cast<char*>("O"), dt.ptr())));
|
||||
}
|
||||
|
||||
ndarray ndarray::astype(dtype const & dt) const
|
||||
{
|
||||
return ndarray(python::detail::new_reference
|
||||
(PyObject_CallMethod(this->ptr(), const_cast<char*>("astype"), const_cast<char*>("O"), dt.ptr())));
|
||||
}
|
||||
|
||||
ndarray ndarray::copy() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user