Re: [Numpy-discussion] floor with dtype

2017-09-27 Thread Renato Fabbri
>>> myarray.astype(n.int)
returns the same values as
>>> n.floor(myarray).astype(n.int)
for positive values??

And the same as
>>> n.trunc(myarray)
for any value?



On Mon, Sep 25, 2017 at 5:36 PM, Mark Bakker  wrote:

> > On 2017-09-25 10:59, Renato Fabbri wrote:
>
>> > > """
>> > > In [3]: n.floor(n.linspace(0,5,7), dtype=n.int )
>> > > 
>> > ---
>> > > TypeError Traceback (most recent call
>> > last)
>> > >  in ()
>> > > > 1 n.floor(n.linspace(0,5,7), dtype=n.int )
>> > >
>> > > TypeError: No loop matching the specified signature and casting
>> > > was found for ufunc floor
>> > >
>> > > In [4]: n.__version__
>> > > Out[4]: '1.11.0'
>> > > """
>> > >
>> > > Is this the expected behavior?
>> >
>> > Yes. There is no floor function for integers.
>> >
>> > The dtype argument specified not only the return type, but the type the
>> > calculation is done in as well. floor() only exists, and only makes
>> > sense, for floats. (You can use floor(a, dtype='f4') and so on to insist
>> > on floats of a different width)
>>
>
> +1 for specifying a dtype in np.floor and np.ceil.
>
> Now it is pretty odd that np.floor and np.ceil results in an integer,
> except for that it doesn't. it returns a float with all zeros as the
> decimals. It would be very useful to be able to specify the dtype at 'int'.
> I frequently use floor or ceil to determine the indices of an array, but
> now need to convert to integers in addition to floor and ceil.
>
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
>


-- 
Renato Fabbri
GNU/Linux User #479299
labmacambira.sourceforge.net
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] ANN: first SciPy 1.0.0 release candidate

2017-09-27 Thread Ralf Gommers
Hi all,

I'm excited to be able to announce the availability of the first release
candidate of Scipy 1.0. This is a big release, and a version number that
has been 16 years in the making. It contains a few more deprecations and
backwards incompatible changes than an average release. Therefore please do
test it on your own code, and report any issues on the Github issue tracker
or on the scipy-dev mailing list.

Sources and binary wheels can be found at https://pypi.python.org/pypi/scipy
and https://github.com/scipy/scipy/releases/tag/v1.0.0rc1. To install with
pip:

pip install --pre --upgrade scipy

Thanks to everyone who contributed to this release!

Ralf



Pull requests merged after v1.0.0b1:

- `#7876 `__: GEN: Add comments
to the tests for clarification
- `#7891 `__: ENH: backport #7879
to 1.0.x
- `#7902 `__: MAINT: signal: Make
freqz handling of multidim. arrays match...
- `#7905 `__: REV: restore
wminkowski
- `#7908 `__: FIX: Avoid bad
``__del__`` (close) behavior
- `#7918 `__: TST: mark two
optimize.linprog tests as xfail. See gh-7877.
- `#7929 `__: MAINT: changed
defaults to lower in sytf2, sytrf and hetrf
- `#7938 `__: MAINT: backports
from 1.0.x
- `#7939 `__: Fix umfpack solver
construction for win-amd64




==
SciPy 1.0.0 Release Notes
==

.. note:: Scipy 1.0.0 is not released yet!

.. contents::

SciPy 1.0.0 is the culmination of 8 months of hard work. It contains
many new features, numerous bug-fixes, improved test coverage and
better documentation.  There have been a number of deprecations and
API changes in this release, which are documented below.  All users
are encouraged to upgrade to this release, as there are a large number
of bug-fixes and optimizations.  Moreover, our development attention
will now shift to bug-fix releases on the 1.0.x branch, and on adding
new features on the master branch.

Some of the highlights of this release are:

- Major build improvements.  Windows wheels are available on PyPI for the
  first time, and continuous integration has been set up on Windows and OS X
  in addition to Linux.
- A set of new ODE solvers and a unified interface to them
  (`scipy.integrate.solve_ivp`).
- Two new trust region optimizers and a new linear programming method, with
  improved performance compared to what `scipy.optimize` offered previously.
- Many new BLAS and LAPACK functions were wrapped.  The BLAS wrappers are
now
  complete.

This release requires Python 2.7 or 3.4+ and NumPy 1.8.2 or greater.

This is also the last release to support LAPACK 3.1.x - 3.3.x.  Moving the
lowest supported LAPACK version to >3.2.x was long blocked by Apple
Accelerate
providing the LAPACK 3.2.1 API.  We have decided that it's time to either
drop
Accelerate or, if there is enough interest, provide shims for functions
added
in more recent LAPACK versions so it can still be used.


New features


`scipy.cluster` improvements


`scipy.cluster.hierarchy.optimal_leaf_ordering`, a function to reorder a
linkage matrix to minimize distances between adjacent leaves, was added.


`scipy.fftpack` improvements


N-dimensional versions of the discrete sine and cosine transforms and their
inverses were added as ``dctn``, ``idctn``, ``dstn`` and ``idstn``.


`scipy.integrate` improvements
--

A set of new ODE solvers have been added to `scipy.integrate`.  The
convenience
function `scipy.integrate.solve_ivp` allows uniform access to all solvers.
The individual solvers (``RK23``, ``RK45``, ``Radau``, ``BDF`` and
``LSODA``)
can also be used directly.


`scipy.linalg` improvements


The BLAS wrappers in `scipy.linalg.blas` have been completed.  Added
functions
are ``*gbmv``, ``*hbmv``, ``*hpmv``, ``*hpr``, ``*hpr2``, ``*spmv``,
``*spr``,
``*tbmv``, ``*tbsv``, ``*tpmv``, ``*tpsv``, ``*trsm``, ``*trsv``, ``*sbmv``,
``*spr2``,

Wrappers for the LAPACK functions ``*gels``, ``*stev``, ``*sytrd``,
``*hetrd``,
``*sytf2``, ``*hetrf``, ``*sytrf``, ``*sycon``, ``*hecon``, ``*gglse``,
``*stebz``, ``*stemr``, ``*sterf``, and ``*stein`` have been added.

The function `scipy.linalg.subspace_angles` has been added to compute the
subspace angles between two matrices.

The function `scipy.linalg.clarkson_woodruff_transform` has been added.
It finds low-rank matrix approximation via the Clarkson-Woodruff Transform.

The functions `scipy.linalg.eigh_tridiagonal` and
`scipy.linalg.eigvalsh_tridiagonal`, which find the eigenvalues and
eigenvectors of tridiagonal hermitian/symmetric matrice

[Numpy-discussion] NumPy 1.13.2 released.

2017-09-27 Thread Charles R Harris
HI All,

On behalf of the NumPy team, I am pleased to annouce the release of Numpy
1.13.2. This is a bugfix release for some problems found since 1.13.1. The
most important fixes are for CVE-2017-12852 and temporary elision. Users of
earlier versions of 1.13 should upgrade.

The Python versions supported are 2.7 and 3.4 - 3.6. The Python 3.6 wheels
available from PIP are built with Python 3.6.2 and should be compatible
with all previous versions of Python 3.6. The Windows wheels are now built
with OpenBlas instead ATLAS, which should improve the performance of the
linearalgebra functions.

Contributors


A total of 12 people contributed to this release.  People with a "+" by
their names contributed a patch for the first time.

* Allan Haldane
* Brandon Carter
* Charles Harris
* Eric Wieser
* Iryna Shcherbina +
* James Bourbeau +
* Jonathan Helmus
* Julian Taylor
* Matti Picus
* Michael Lamparski +
* Michael Seifert
* Ralf Gommers

Pull requests merged


A total of 20 pull requests were merged for this release.

* #9390 BUG: Return the poly1d coefficients array directly
* #9555 BUG: Fix regression in 1.13.x in distutils.mingw32ccompiler.
* #9556 BUG: Fix true_divide when dtype=np.float64 specified.
* #9557 DOC: Fix some rst markup in numpy/doc/basics.py.
* #9558 BLD: Remove -xhost flag from IntelFCompiler.
* #9559 DOC: Removes broken docstring example (source code, png, pdf)...
* #9580 BUG: Add hypot and cabs functions to WIN32 blacklist.
* #9732 BUG: Make scalar function elision check if temp is writeable.
* #9736 BUG: Various fixes to np.gradient
* #9742 BUG: Fix np.pad for CVE-2017-12852
* #9744 BUG: Check for exception in sort functions, add tests
* #9745 DOC: Add whitespace after "versionadded::" directive so it
actually...
* #9746 BUG: Memory leak in np.dot of size 0
* #9747 BUG: Adjust gfortran version search regex
* #9757 BUG: Cython 0.27 breaks NumPy on Python 3.
* #9764 BUG: Ensure `_npy_scaled_cexp{,f,l}` is defined when needed.
* #9765 BUG: PyArray_CountNonzero does not check for exceptions
* #9766 BUG: Fixes histogram monotonicity check for unsigned bin values
* #9767 BUG: Ensure consistent result dtype of count_nonzero
* #9771 BUG, MAINT: Fix mtrand for Cython 0.27.

Enjoy

Chuck
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion