Re: [Numpy-discussion] floats for indexing, reshape - too strict ?
FYI pandas followed the same pattern to deprecate float indexers (except for indexing in a Float64Index) about a year ago see here: http://pandas.pydata.org/pandas-docs/stable/whatsnew.html#whatsnew-0140-deprecations > On Jul 2, 2015, at 9:18 PM, > wrote: > > > >> On Thu, Jul 2, 2015 at 8:51 PM, Chris Barker - NOAA Federal >> wrote: >> Sent from my iPhone >> >> > >> > The disadvantage I see is, that some weirder calculations would possible >> > work most of the times, but not always, >> >> >> > not sure if you can define a "tolerance" >> > reasonable here unless it is exact. >> >> You could use a relative tolerance, but you'd still have to set that. >> Better to put that decision squarely in the user's hands. >> >> > Though I guess you are right that >> > `//` will also just round silently already. >> >> Yes, but if it's in the user's code, it should be obvious -- and then >> the user can choose to round, or floor, or ceiling > > round, floor, ceil don't produce integers. > > I'm writing library code, and I don't have control over what everyone does. > > round, floor, ceil, and // might hide bugs or user mistakes, if we are > supposed to get something that is "like an int" but it's. 42.6 instead. > > Josef > https://en.wikipedia.org/wiki/Phrases_from_The_Hitchhiker%27s_Guide_to_the_Galaxy#Answer_to_the_Ultimate_Question_of_Life.2C_the_Universe.2C_and_Everything_.2842.29 > > >> >> -CHB >> >> > >> > - Sebastian >> > >> >> >> >> for example >> >> >> >> >> > 5.0 == 5 >> >> True >> >> >> >> >> > np.ones(10 / 2) >> >> array([ 1., 1., 1., 1., 1.]) >> > 10 / 2 == 5 >> >> True >> >> >> >> >> >> or the python 2 version >> >> >> >> >> > np.ones(10. / 2) >> >> array([ 1., 1., 1., 1., 1.]) >> > 10. / 2 == 5 >> >> True >> >> >> >> >> >> I'm using now 10 // 2, or int(10./2 + 1) but this is unconditional >> >> and doesn't raise if the numbers are not close or equal to an integer >> >> (which would be a bug) >> >> >> >> >> >> >> >> >> >> Josef >> >> >> >> >> >> >> >> >> >> ___ >> >> NumPy-Discussion mailing list >> >> NumPy-Discussion@scipy.org >> >> http://mail.scipy.org/mailman/listinfo/numpy-discussion >> > >> > ___ >> > NumPy-Discussion mailing list >> > NumPy-Discussion@scipy.org >> > http://mail.scipy.org/mailman/listinfo/numpy-discussion >> ___ >> NumPy-Discussion mailing list >> NumPy-Discussion@scipy.org >> http://mail.scipy.org/mailman/listinfo/numpy-discussion > > ___ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] floats for indexing, reshape - too strict ?
On Thu, Jul 2, 2015 at 8:51 PM, Chris Barker - NOAA Federal < chris.bar...@noaa.gov> wrote: > Sent from my iPhone > > > > > The disadvantage I see is, that some weirder calculations would possible > > work most of the times, but not always, > > > > not sure if you can define a "tolerance" > > reasonable here unless it is exact. > > You could use a relative tolerance, but you'd still have to set that. > Better to put that decision squarely in the user's hands. > > > Though I guess you are right that > > `//` will also just round silently already. > > Yes, but if it's in the user's code, it should be obvious -- and then > the user can choose to round, or floor, or ceiling > round, floor, ceil don't produce integers. I'm writing library code, and I don't have control over what everyone does. round, floor, ceil, and // might hide bugs or user mistakes, if we are supposed to get something that is "like an int" but it's. 42.6 instead. Josef https://en.wikipedia.org/wiki/Phrases_from_The_Hitchhiker%27s_Guide_to_the_Galaxy#Answer_to_the_Ultimate_Question_of_Life.2C_the_Universe.2C_and_Everything_.2842.29 > > -CHB > > > > > - Sebastian > > > >> > >> for example > >> > >> > > 5.0 == 5 > >> True > >> > >> > > np.ones(10 / 2) > >> array([ 1., 1., 1., 1., 1.]) > > 10 / 2 == 5 > >> True > >> > >> > >> or the python 2 version > >> > >> > > np.ones(10. / 2) > >> array([ 1., 1., 1., 1., 1.]) > > 10. / 2 == 5 > >> True > >> > >> > >> I'm using now 10 // 2, or int(10./2 + 1) but this is unconditional > >> and doesn't raise if the numbers are not close or equal to an integer > >> (which would be a bug) > >> > >> > >> > >> > >> Josef > >> > >> > >> > >> > >> ___ > >> NumPy-Discussion mailing list > >> NumPy-Discussion@scipy.org > >> http://mail.scipy.org/mailman/listinfo/numpy-discussion > > > > ___ > > NumPy-Discussion mailing list > > NumPy-Discussion@scipy.org > > http://mail.scipy.org/mailman/listinfo/numpy-discussion > ___ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion > ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] floats for indexing, reshape - too strict ?
Sent from my iPhone > > The disadvantage I see is, that some weirder calculations would possible > work most of the times, but not always, > not sure if you can define a "tolerance" > reasonable here unless it is exact. You could use a relative tolerance, but you'd still have to set that. Better to put that decision squarely in the user's hands. > Though I guess you are right that > `//` will also just round silently already. Yes, but if it's in the user's code, it should be obvious -- and then the user can choose to round, or floor, or ceiling -CHB > > - Sebastian > >> >> for example >> >> > 5.0 == 5 >> True >> >> > np.ones(10 / 2) >> array([ 1., 1., 1., 1., 1.]) > 10 / 2 == 5 >> True >> >> >> or the python 2 version >> >> > np.ones(10. / 2) >> array([ 1., 1., 1., 1., 1.]) > 10. / 2 == 5 >> True >> >> >> I'm using now 10 // 2, or int(10./2 + 1) but this is unconditional >> and doesn't raise if the numbers are not close or equal to an integer >> (which would be a bug) >> >> >> >> >> Josef >> >> >> >> >> ___ >> NumPy-Discussion mailing list >> NumPy-Discussion@scipy.org >> http://mail.scipy.org/mailman/listinfo/numpy-discussion > > ___ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Video meeting this week
unfortunately I can't start the hangout. Both Firefox and chrome hangs. Tried it again and again. For this reason a short status: I can now build the mingwpy toolchain as pip installable wheel. %USERPROFILE%\pydistutils.cfg should be configured to use the mingw compiler. With the preliminary mingwpy wheels deployed at binstar: (2.7, 3.3, 3.4 / amd64, win32): pip install -i https://pypi.binstar.org/carlkl/simple mingwpy the toolchain can be installed. Test i.e. it with bottleneck: pip install bottleneck compiles and installs the bottleneck package on the fly. I would like to add some documenation to the package and wait for some feedback from others before deployment on pypi. Supplementary libraries (like OpenBLAS) should be provided as individual packages. I will need some time at the weekend to put all this stuff on github as well as many of my usual manual steps had to be scripted first. There is a lot of my TODO list: - further work numpy, scipy compiled with mingwpy and OpenBLAS - setup documenation and mingwpy.org - deploy on PYPI - win32 bugs in the math code of mingwpw - precision failures with scipy.test - alternative implemention of some transz. numeric functions in minw-w64 Wait for your feedback Cheers Carl 2015-07-02 22:04 GMT+02:00 Ralf Gommers : > > > On Thu, Jul 2, 2015 at 10:01 PM, Honi Sanders wrote: > >> I’m interested in listening in just to see what it’s like, but I have to >> leave after ~15 minutes because I have a meeting at 4:30. Is that too >> disruptive? >> > > Don't worry about it, just join as long as you can. > > Ralf > > > >> >> > On Jul 2, 2015, at 3:59 PM, Nathaniel Smith wrote: >> > >> > Hi all, >> > >> > Meeting is starting in a few minutes! >> > >> > Hangouts link: >> > https://plus.google.com/hangouts/_/gxtuplvm6g7s55abhjexqerll4a >> > >> > Google doc for agenda and notes: >> > >> https://docs.google.com/document/d/11KC2p3cCsbDVjLcQSCehUiWGyWDNCyOunKfrO7Q7m3E/edit?usp=sharing >> > >> > Wiki page: >> > https://github.com/numpy/numpy/wiki/SciPy-2015-developer-meeting >> > >> > -n >> > >> > On Fri, Jun 26, 2015 at 2:32 AM, Nathaniel Smith wrote: >> >> Hi all, >> >> >> >> In a week and a half, this is happening: >> >> >> >>https://github.com/numpy/numpy/wiki/SciPy-2015-developer-meeting >> >> >> >> It's somewhat short notice (my bad :-/), but I think it would be good >> >> to have a short video meeting sometime this week as a kind of >> >> "pre-meeting" -- to at least briefly go over the main issues we see >> >> facing the project to prime the pump, get a better idea about what we >> >> want to accomplish at the meeting itself, and gather some early >> >> feedback from anyone who won't be able to make it to SciPy (we'll miss >> >> you). >> >> >> >> The obligatory doodle: >> >>http://doodle.com/6b4s6thqt9xt4vnh >> >> >> >> Depending on the interest level, I'm thinking we'll either use Google >> >> Hangouts or Bluejeans (https://bluejeans.com/ -- same as what Ralf >> >> used for the similar SciPy meeting a few months ago; needs a plugin >> >> installed but is available for Windows / OS X / 64-bit Linux / Android >> >> / iOS, or regular telephone, or h323 softphone). >> >> >> >> -n >> >> >> >> -- >> >> Nathaniel J. Smith -- http://vorpus.org >> > >> > >> > >> > -- >> > Nathaniel J. Smith -- http://vorpus.org >> > ___ >> > NumPy-Discussion mailing list >> > NumPy-Discussion@scipy.org >> > http://mail.scipy.org/mailman/listinfo/numpy-discussion >> >> ___ >> NumPy-Discussion mailing list >> NumPy-Discussion@scipy.org >> http://mail.scipy.org/mailman/listinfo/numpy-discussion >> > > > ___ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion > > ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Video meeting this week
On Thu, Jul 2, 2015 at 10:01 PM, Honi Sanders wrote: > I’m interested in listening in just to see what it’s like, but I have to > leave after ~15 minutes because I have a meeting at 4:30. Is that too > disruptive? > Don't worry about it, just join as long as you can. Ralf > > > On Jul 2, 2015, at 3:59 PM, Nathaniel Smith wrote: > > > > Hi all, > > > > Meeting is starting in a few minutes! > > > > Hangouts link: > > https://plus.google.com/hangouts/_/gxtuplvm6g7s55abhjexqerll4a > > > > Google doc for agenda and notes: > > > https://docs.google.com/document/d/11KC2p3cCsbDVjLcQSCehUiWGyWDNCyOunKfrO7Q7m3E/edit?usp=sharing > > > > Wiki page: > > https://github.com/numpy/numpy/wiki/SciPy-2015-developer-meeting > > > > -n > > > > On Fri, Jun 26, 2015 at 2:32 AM, Nathaniel Smith wrote: > >> Hi all, > >> > >> In a week and a half, this is happening: > >> > >>https://github.com/numpy/numpy/wiki/SciPy-2015-developer-meeting > >> > >> It's somewhat short notice (my bad :-/), but I think it would be good > >> to have a short video meeting sometime this week as a kind of > >> "pre-meeting" -- to at least briefly go over the main issues we see > >> facing the project to prime the pump, get a better idea about what we > >> want to accomplish at the meeting itself, and gather some early > >> feedback from anyone who won't be able to make it to SciPy (we'll miss > >> you). > >> > >> The obligatory doodle: > >>http://doodle.com/6b4s6thqt9xt4vnh > >> > >> Depending on the interest level, I'm thinking we'll either use Google > >> Hangouts or Bluejeans (https://bluejeans.com/ -- same as what Ralf > >> used for the similar SciPy meeting a few months ago; needs a plugin > >> installed but is available for Windows / OS X / 64-bit Linux / Android > >> / iOS, or regular telephone, or h323 softphone). > >> > >> -n > >> > >> -- > >> Nathaniel J. Smith -- http://vorpus.org > > > > > > > > -- > > Nathaniel J. Smith -- http://vorpus.org > > ___ > > NumPy-Discussion mailing list > > NumPy-Discussion@scipy.org > > http://mail.scipy.org/mailman/listinfo/numpy-discussion > > ___ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion > ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Video meeting this week
I’m interested in listening in just to see what it’s like, but I have to leave after ~15 minutes because I have a meeting at 4:30. Is that too disruptive? > On Jul 2, 2015, at 3:59 PM, Nathaniel Smith wrote: > > Hi all, > > Meeting is starting in a few minutes! > > Hangouts link: > https://plus.google.com/hangouts/_/gxtuplvm6g7s55abhjexqerll4a > > Google doc for agenda and notes: > > https://docs.google.com/document/d/11KC2p3cCsbDVjLcQSCehUiWGyWDNCyOunKfrO7Q7m3E/edit?usp=sharing > > Wiki page: > https://github.com/numpy/numpy/wiki/SciPy-2015-developer-meeting > > -n > > On Fri, Jun 26, 2015 at 2:32 AM, Nathaniel Smith wrote: >> Hi all, >> >> In a week and a half, this is happening: >> >>https://github.com/numpy/numpy/wiki/SciPy-2015-developer-meeting >> >> It's somewhat short notice (my bad :-/), but I think it would be good >> to have a short video meeting sometime this week as a kind of >> "pre-meeting" -- to at least briefly go over the main issues we see >> facing the project to prime the pump, get a better idea about what we >> want to accomplish at the meeting itself, and gather some early >> feedback from anyone who won't be able to make it to SciPy (we'll miss >> you). >> >> The obligatory doodle: >>http://doodle.com/6b4s6thqt9xt4vnh >> >> Depending on the interest level, I'm thinking we'll either use Google >> Hangouts or Bluejeans (https://bluejeans.com/ -- same as what Ralf >> used for the similar SciPy meeting a few months ago; needs a plugin >> installed but is available for Windows / OS X / 64-bit Linux / Android >> / iOS, or regular telephone, or h323 softphone). >> >> -n >> >> -- >> Nathaniel J. Smith -- http://vorpus.org > > > > -- > Nathaniel J. Smith -- http://vorpus.org > ___ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Video meeting this week
Hi all, Meeting is starting in a few minutes! Hangouts link: https://plus.google.com/hangouts/_/gxtuplvm6g7s55abhjexqerll4a Google doc for agenda and notes: https://docs.google.com/document/d/11KC2p3cCsbDVjLcQSCehUiWGyWDNCyOunKfrO7Q7m3E/edit?usp=sharing Wiki page: https://github.com/numpy/numpy/wiki/SciPy-2015-developer-meeting -n On Fri, Jun 26, 2015 at 2:32 AM, Nathaniel Smith wrote: > Hi all, > > In a week and a half, this is happening: > > https://github.com/numpy/numpy/wiki/SciPy-2015-developer-meeting > > It's somewhat short notice (my bad :-/), but I think it would be good > to have a short video meeting sometime this week as a kind of > "pre-meeting" -- to at least briefly go over the main issues we see > facing the project to prime the pump, get a better idea about what we > want to accomplish at the meeting itself, and gather some early > feedback from anyone who won't be able to make it to SciPy (we'll miss > you). > > The obligatory doodle: > http://doodle.com/6b4s6thqt9xt4vnh > > Depending on the interest level, I'm thinking we'll either use Google > Hangouts or Bluejeans (https://bluejeans.com/ -- same as what Ralf > used for the similar SciPy meeting a few months ago; needs a plugin > installed but is available for Windows / OS X / 64-bit Linux / Android > / iOS, or regular telephone, or h323 softphone). > > -n > > -- > Nathaniel J. Smith -- http://vorpus.org -- Nathaniel J. Smith -- http://vorpus.org ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] floats for indexing, reshape - too strict ?
Antoine Pitrou wrote: > I don't think relaxing type checking here makes any good. I agee. NumPy should do the same as Python in this case. Sturla ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Biased random number generator
Dear All, I have recently developed some features that I think can be useful for others. I would like to contribute by providing the code of the following definitions BiasedRandomFloatGenerator BiasedRandomIntegerGenerator please find the help of those two classes here http://bachiraoun.github.io/fullrmc/fullrmc.Core.html#module-fullrmc.Core.Collection Personally, I am using those generators to model molecular structures by reverse engineering experimental data. The generators accumulate experience through the whole modelling process and automatically update the generation scheme (numbers probability) according to some success / failure parameter. If you think this is something that might be interesting and has the potential to being distributed in the coming Numpy versions please let me know. regards -- Bachir AOUN ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] floats for indexing, reshape - too strict ?
On Thu, 02 Jul 2015 08:40:13 -0400 Neal Becker wrote: > I'd be concerned that checking each index for exactness would be costly. > I'm also concerned that using floats for an index is frequently a mistake > and that a warning is what I want. Or just follow Python: Python 3.4.3 |Continuum Analytics, Inc.| (default, Jun 4 2015, 15:29:08) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> [1][0.0] Traceback (most recent call last): File "", line 1, in TypeError: list indices must be integers, not float I don't think relaxing type checking here makes any good. Regards Antoine. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] floats for indexing, reshape - too strict ?
josef.p...@gmail.com wrote: > On Wed, Jul 1, 2015 at 10:32 AM, Sebastian Berg > wrote: > >> On Mi, 2015-07-01 at 10:05 -0400, josef.p...@gmail.com wrote: >> > About the deprecation warning for using another type than integers, in >> > ones, reshape, indexing and so on: >> > >> > >> > Wouldn't it be nicer to accept floats that are equal to an integer? >> > >> I'd be concerned that checking each index for exactness would be costly. I'm also concerned that using floats for an index is frequently a mistake and that a warning is what I want. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion