I don't want my python code to run multi-thread. So I can do:
MKL_NUM_THREAD=1 NUMEXPR_NUM_THREADS=1 OMP_NUM_THREADS=1 my_program...
But I don't seem to be able to achieve this effect without setting env
variables on the command line; within my_program. Using os.environ doesn't
work. I don't u
Ah, that probably explains it!
On Fri, Mar 24, 2017 at 7:37 AM Daπid wrote:
> On 24 March 2017 at 12:30, Neal Becker wrote:
> > Using os.environ doesn't
> > work. I don't understand why.
>
> It should, I do that for other variables. Are you setting the
>
Take a look here:
https://bashtage.github.io/ng-numpy-randomstate/doc/index.html
On Mon, Apr 3, 2017 at 9:45 AM Jaime Fernández del Río
wrote:
> On Mon, Apr 3, 2017 at 3:20 PM, Pierre Haessig
> wrote:
>
> Hello,
> Le 30/03/2017 à 13:31, Pierre Haessig a écrit :
>
> []
>
> But how come Julia
I think the intention is that this is the next gen of numpy randomstate,
and will eventually be merged in.
On Mon, Apr 3, 2017 at 11:47 AM Pierre Haessig
wrote:
>
> Le 03/04/2017 à 15:52, Neal Becker a écrit :
> > Take a look here:
> > https://bashtage.github.io/ng-num
I'm no unicode expert, but can't we truncate unicode strings so that only
valid characters are included?
On Thu, Apr 20, 2017 at 1:32 PM Chris Barker wrote:
> On Thu, Apr 20, 2017 at 9:47 AM, Anne Archibald > wrote:
>
>> Is there any reason not to support all Unicode encodings that python
>> do
So while compression+ucs-4 might be OK for out-of-core representation, what
about in-core? blosc+ucs-4? I don't think that works for mmap, does it?
On Thu, Apr 27, 2017 at 7:11 AM Francesc Alted wrote:
> 2017-04-27 3:34 GMT+02:00 Stephan Hoyer :
>
>> On Wed, Apr 26, 2017 at 4:49 PM, Nathaniel
I've searched but haven't found any decent answer. I need to call Matlab
from python. Matlab has a python module for this purpose, but it doesn't
understand numpy AFAICT. What solutions are there for efficiently
interfacing numpy arrays to Matlab?
Thanks,
Neal
__
it a try myself, but it looks promising.
>>
>> On Mon, Aug 28, 2017 at 4:21 PM, Stephan Hoyer wrote:
>>
>>> If you can use Octave instead of Matlab, I've had a very good experience
>>> with Oct2Py:
>>> https://github.com/blink1073/oct2py
>>>
&g
On Fri, Jan 19, 2018 at 6:13 PM Nathaniel Smith wrote:
> ...
> I agree that relaxing our policy would be better than the status quo.
> Before making any decisions, though, I'd like to make sure we
> understand the alternatives and their trade-offs. Specifically, I
> think the main alternative
What is the syntax to construct an initialized generator?
RandomGenerator(Xoroshiro128(my_seed))?
On Thu, Feb 22, 2018 at 6:06 AM Kevin Sheppard
wrote:
> I have implemented a working prototype of a pluggable RandomState. The
> repo is located at https://github.com/bashtage/core-prng.
>
> The ma
After update to numpy-1.5.0, I'm getting warnings from scipy.
These probably come from my code using convolve. Does scipy need updating?
/home/nbecker/.local/lib/python3.6/site-packages/scipy/fftpack/basic.py:160:
FutureWarning: Using a non-tuple sequence for multidimensional indexing is
deprecat
The only way I've seen xtensor used is *with* pybind11
On Fri, Aug 17, 2018 at 5:45 PM Robert Kern wrote:
> On Fri, Aug 17, 2018 at 2:00 AM Hans Dembinski
> wrote:
>
>> Hi Sylvain,
>>
>> On 16. Aug 2018, at 13:29, Sylvain Corlay
>> wrote:
>>
>> Actually, xtensor-python does a lot more in terms
I'm confused, do you have a link or example showing how to use
xtensor-python without pybind11?
Thanks,
Neal
On Mon, Aug 20, 2018 at 5:50 PM Hans Dembinski
wrote:
> Dear Robert,
>
> > On 17. Aug 2018, at 23:44, Robert Kern wrote:
> >
> > Even if you don't use the numpy-mimicking parts of the xt
Define "doing fine", does it pass all tests?
On Fri, Jan 4, 2019 at 12:36 PM Charles R Harris
wrote:
> Hi All,
>
> Just asking if the `-fno-strict-aliasing` flag is still required for gcc.
> Supposedly `-fstrict-aliasing` is enabled by default with optimization
> levels >= `-O2` and that used to
constants are easier to support for autocompletion than strings. My
current env (emacs) will (usually) autocomplete the former, but not the
latter.
On Thu, Jan 10, 2019 at 2:21 PM Feng Yu wrote:
> Hi Todd,
>
> I agree a flag is more suitable than classes.
>
> I would add another bonus of a flag
The boost_random c++ library uses the terms 'generators' and
'distributions'. Distributions are applied to generators.
On Fri, Apr 19, 2019 at 7:54 AM Kevin Sheppard
wrote:
>
> > Rather than "base RNG", what about calling these classes a "random source"
> or "random stream"? In particular, I wo
On Wed, Jun 5, 2019 at 4:42 PM Sebastian Berg
wrote:
I think the best approach is that if the user gave unambiguous types
as inputs to operators then the output should be the same dtype, or
type corresponding to the common promotion type of the inputs.
If the input type is not specified, I agree
I see a float16 dtype but not complex32. Is this an oversight?
Thanks,
Neal
--
Those who don't understand recursion are doomed to repeat it
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-di
I have used C-api in the past, and would like to see a convenient and
stable way to do this. Currently I'm using randomgen, but calling
(from c++)
to the python api. The inefficiency is amortized by generating and
caching batches of results.
I thought randomgen was supposed to be the future of n
Matti Picus wrote:
>
> On 20/9/19 2:18 pm, Neal Becker wrote:
> > I have used C-api in the past, and would like to see a convenient and
> > stable way to do this. Currently I'm using randomgen, but calling
> > (from c++)
> > to the python api. The inefficiency is
max(axis=1)?
On Wed, Oct 30, 2019, 7:33 PM Daniele Nicolodi wrote:
> Hello,
>
> this is a very basic question, but I cannot find a satisfying answer.
> Assume a is a 2D array and that I get the index of the maximum value
> along the second dimension:
>
> i = a.argmax(axis=1)
>
> Is there a bette
Slightly off topic perhaps, it is recommended to perform custom compilation
for best performance, yet is there an
easy way to do this? I don't think a simple pip will do.
On Wed, Feb 5, 2020 at 4:07 AM Matthew Brett
wrote:
> Hi,
>
> On Tue, Feb 4, 2020 at 10:38 PM Nathaniel Smith wrote:
> >
>
Stefan van der Walt wrote:
> Hi all,
>
> This has been mentioned on the community calls, but not on the mailing
> list, so a reminder about the Tensor Developer Summit happening at March
> in Berkeley:
>
> https://xd-con.org/tensor-2020/
>
> We would love to have developers and advanced users o
Consider the following:
from numpy.random import default_rng
rs = default_rng()
Now how do I re-seed the generator?
I thought perhaps rs.bit_generator.seed(), but there is no such attribute.
Thanks,
Neal
--
*Those who don't understand recursion are doomed to repeat it*
Honestly, I don't find "forward" very informative. There isn't any real
convention on whether FFT of IFFT have any normalization.
To the best of my experience, either forward or inverse could be normalized
by 1/N, or each normalized by 1/sqrt(N), or neither
could be normalized. I will say my expe
I was using this to reset the generator, in order to repeat the same
sequence again for testing purposes.
On Wed, Jun 24, 2020 at 6:40 PM Robert Kern wrote:
> On Wed, Jun 24, 2020 at 3:31 PM Neal Becker wrote:
>
>> Consider the following:
>>
>> from numpy.random
On Sat, Jul 4, 2020 at 1:56 PM Robert Kern wrote:
>
> 3. Is there a way of telling the number of draws a generator did?
>>
>> The use case is to checkpoint the number of draws and `.advance` the
>> bit generator when resuming from the checkpoint. (The runs are longer
>> then the batch queue
I have code that performs dot product of a 2D matrix of size (on the
order of) [1000,16] with a vector of size [1000]. The matrix is
float64 and the vector is complex128. I was using numpy.dot but it
turned out to be a bottleneck.
So I coded dot2x1 in c++ (using xtensor-python just for the
inter
ou install numpy from conda-forge you should be able to
> switch between OpenBLAS, MKL and BLIS:
> https://conda-forge.org/docs/maintainer/knowledge_base.html#switching-blas-implementation
>
> Roman
>
> On 23/02/2021 19:32, Andrea Gavana wrote:
> > Hi,
> >
> > On
las.
On Tue, Feb 23, 2021 at 1:51 PM Neal Becker wrote:
>
> One suspect is that it seems the numpy version was multi-threading.
> This isn't useful here, because I'm running parallel monte-carlo
> simulations using all cores. Perhaps this is perversely slowing
> things d
>>
>>
>>
>> On Tue, Feb 23, 2021 at 11:10 AM Neal Becker wrote:
>>>
>>> I have code that performs dot product of a 2D matrix of size (on the
>>> order of) [1000,16] with a vector of size [1000]. The matrix is
>>> float64 and the ve
Supposedly can control through env variables but I didn't see any effect
On Wed, Feb 24, 2021, 10:12 AM Charles R Harris
wrote:
>
>
> On Wed, Feb 24, 2021 at 8:02 AM Charles R Harris <
> charlesr.har...@gmail.com> wrote:
>
>>
>>
>> On Wed, Feb 24, 20
There's a little pi day easter egg for all math fans. Google for pi to
find it.
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion
This seems like something that can be done with indexing, but I
haven't found the solution.
out is a 2D array is initialized to zeros. x is a 1D array whose
values correspond to the columns of out. For each row in out, set
out[row,x[row]] = 1. Here is working code:
def orthogonal_mod (x, nbits)
Thanks!
On Thu, May 20, 2021 at 9:53 AM Robert Kern wrote:
>
> On Thu, May 20, 2021 at 9:47 AM Neal Becker wrote:
>>
>> This seems like something that can be done with indexing, but I
>> haven't found the solution.
>>
>> out is a 2D array is ini
Topk is a bad choice imo. I initially parsed it as to_pk, and had no idea
what that was, although sounded a lot like a scipy signal function.
Nlargest would be very obvious.
On Sun, May 30, 2021, 7:50 AM Alan G. Isaac wrote:
> Mathematica and Julia both seem relevant here.
> Mma has TakeLargest
In my application I need to pack bits of a specified group size into
integral values.
Currently np.packbits only packs into full bytes.
For example, I might have a string of bits encoded as a np.uint8
vector with each uint8 item specifying a single bit 1/0. I want to
encode them 4 bits at a time i
Well that's just the point, I wanted to consider group size > 8.
On Wed, Jul 21, 2021 at 8:53 AM Andras Deak wrote:
>
> On Wed, Jul 21, 2021 at 2:40 PM Neal Becker wrote:
>>
>> In my application I need to pack bits of a specified group size into
>> integral value
A couple of questions from a quick casual reading
1. radixsort (void *start...)
Do we really need void*? We don't know the type of start at compile time?
2. reinterpret_cast start (related to #1).
3. reinterpret_cast(malloc(num * sizeof(T)));
A C-ism. Would it work to use new T[num]?
On Tue,
I've also used uncrustify for c/c++. Of course this plays hell with
revision control.
On Sun, Nov 14, 2021 at 6:29 PM Juan Nunez-Iglesias wrote:
>
>
>
> On 15 Nov 2021, at 8:23 am, Stefan van der Walt wrote:
>
> On Sun, Nov 14, 2021, at 09:13, Charles R Harris wrote:
>
> The black formatter is
>
>
> the loading time (from an nvme drive, Ubuntu 18.04, python 3.6.9, numpy
> 1.19.5) for each file is listed below:
>
> 0.179s eye1e4.npy (mmap_mode=None)
> 0.001s eye1e4.npy (mmap_mode=r)
> 0.718s eye1e4_bjd_raw_ndsyntax.jdb
> 1.474s eye1e4_bjd_zlib.jdb
> 0.635s eye1e4_bjd_lzma.jdb
>
>
> c
I have a function F
def F(a, b):
c = a * b
Initially, a is a scalar, b[240,3000]. No problem.
Later I want to use F, where a[240] is a vector. I want to allow both the
scalar and vector cases. So I write:
def F(a,b):
a = np.atleast_1d(a)
c = a[:,None] * b
This now works for scalar a o
On Thu, Mar 23, 2023 at 5:21 AM Sebastian Berg
wrote:
> On Wed, 2023-03-22 at 12:00 -0400, Robert Kern wrote:
> > On Wed, Mar 22, 2023 at 9:34 AM Neal Becker
> > wrote:
> >
> > > I have a function F
> > > def F(a, b):
> > > c = a * b
> &
On a somewhat related note, I usually find I need to compute stats
incrementally. To do this, a stat object is created so batches of samples
can be fed to it sequentially.
I used to use an implementation based on boost::accumulator for this. More
recently I'm using my own c++ code based on xtens
Thanks Juan, this is really great! I plan to make use of this right away.
On Wed, Nov 1, 2023 at 8:13 AM Juan Nunez-Iglesias wrote:
> Have you tried timing things? Thankfully this is easy to test because the
> Python source of numba-jitted functions is available at jitted_func.py_func.
>
> In [
In my opinion, with the caveat that anyone that asks for the sign of a
complex number gets what they deserve, this seems about as useful a
definition as any.
On Fri, Dec 22, 2023 at 8:23 AM wrote:
> Hi All,
>
> A long-standing, small wart in numpy has been that the definition of sign
> for compl
argmin of an empty sequence throws an exception, which I think is a
good thing:
np.argmin([])
---
ValueError
But not for a masked array:
n [24]: u = np.arange (10)
In [25]: v = np.ma.array (u, mask=np.ones(10))
In [26]: v
On Fri, Aug 2, 2024 at 9:37 AM Robert Kern wrote:
> On Fri, Aug 2, 2024 at 1:28 AM Andrew Nelson wrote:
>
>> When using the new `Generator`s for stochastic optimisation I sometimes
>> find myself possessing a great solution, but am wondering what path the
>> random number generation took to get
48 matches
Mail list logo