Bruce Who wrote:
> Hi, Travis
>
> I can pack my scripts into an executable with py2exe, but errors occur
> once it runs:
I suspect you need to force-include the numpy/core/_internal.py file by
specifying it in your setup.py file as explained on the py2exe site.
That module is only
s = N.random.rand(count)
cprobs = N.cumsum([0]+probs)
nums *= cprobs[-1]
for k, val in enumerate(probs):
res[k][0] += ((nums > cprobs[k]) & (nums < cprobs[k+1])).sum()
return res
-Travis Oliphant
--
http://mail.python.org/mailman/listinfo/python-list
interpreted as (PyObject **) -- an array of
PyObject *'s, and then de-referenced to get the PyObject * present at
the first address
So. this should work to check that the first entry in the array is a
string:
PyString_Check( *( ( PyObject ** )( pArray->data ) ) );
By the way, NumPy
mPy is growing and I
expect that trend to continue. There is a lot of information in the
source file.
>
> I guess I'll come back to NumPy in 2010, when the docs are available.
>
Or just ask on the mailing lists, use the numpy.oldnumeric interface
(the differences are all documented in the first few pages of my book
which is available for free now).
Thanks,
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
solution to this question that works with numpy.
You can also view the array using fields and then sort (which will do
lexicographic ordering) and convert the result back to the original view.
Something like this:
a = array([[5,2],[1,3]])
dt = a.dtype
g = a.view([('',dt),('
a=data+row
>
>
> The purpose of this part of a program is to take a 14 bit numerical
> representation and convert it to an 8 bit representation.
This is exactly the kind of thing NumPy (http://numeric.scipy.org) is
ideal for. If that's of interest to you, then I can offer particular
suggestions...
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
y to profile the C++ functions?
>
On Linux you can use oprofile (which is pretty nice and easy to use ---
no recompiling. Just start the profiler, run your code, and stop the
profiler).
http://oprofile.sourceforge.net/about/
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
ut 4 decimal places.
You need to use the tostring() method and write that out in binary form.
flon = open(lon_file,'wb')
flon.write(your2darray.tostring())
of course you will need to manage byte-order issues if you will be
transferring this file to a different kind of processor.
Alternatively, with new NumPy there is a tofile method that you can use
to write in either ascii or binary form.
-Travis Oliphant
--
http://mail.python.org/mailman/listinfo/python-list
mclaugb wrote:
> Is Scipy the same thing as ScientificPython?
No. They are two separate projects. Scientific Python is still
Numeric-only. SciPy 0.3.x is Numeric-based and SciPy 0.4.x is NumPy-based.
The developers for NumPy are also the developers for SciPy (for the most
part).
There is a
of the improvements). If there are missing
improvements we need to know about them.
Thanks to Tim for spreading some light on the issue. There will no
doubt be continued confusion for new users over the coming months.
Hopefully, with time the confusion will fade as more people use NumPy
and any remainging issues get resolved.
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
s at
http://sourceforge.net/project/shownotes.php?release_id=394206&group_id=1369
Best regards,
-Travis Oliphant
--
http://mail.python.org/mailman/listinfo/python-list
change x to be double precision:
x = zeros(len(t), float)
#the default Python float is doubleprecision
or change t to be single precision:
t = arange(0,20,.1,dtype=single)
Good luck,
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
Thomas Gellekum wrote:
> "Travis E. Oliphant" <[EMAIL PROTECTED]> writes:
>
>
>> - Improvements to numpy.distutils
>
>
> Stupid questions: is it really necessary to keep your own copy of
> distutils and even install it? What's wrong with the
rough the C-code for other cases as well because of the increased
flexibility.
Our goal is to be as fast as we can be so give it a spin and tell us how
to improve...
Thanks,
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
simply by replacing Numeric/arrayobject.h with
numpy/arrayobject.h
If you don't like things then start suggesting specific improvements at
[EMAIL PROTECTED] instead of just ranting on the
python list which most of us don't have the time to read anyway (notice
how late I'm responding to this...)
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
vior experienced by others on the Debian
platform. There is a patch, but I'm not sure what it is.
See, for example:
http://aspn.activestate.com/ASPN/Mail/Message/numpy-discussion/2207861
Come over to the [EMAIL PROTECTED] and/or
[EMAIL PROTECTED]
lists for more help.
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
ds on the type of
> scalar).
>
numpy scalars are try a lot more things before giving up on
multiplication and letting the other class have a stab at it.
Post your problems to the numpy discussion list for better help and more
discussion.
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
We are pleased to announce the release of NumPy 1.0.2
NumPy is a Python extension that provides a general-purpose
multi-dimensional array that can act as a container of arbitrary
raw-data formats (including bools, integers, floats, complex, Python
objects, string, unicode, and general C-struct
YI - The csv file was
> a simple 6 column file with a header row and more than a million
> records.
>
>
There is some facility to read simply-formatted files directly into NumPy.
You might try something like this.
numpy.fromfile('somename.csv', sep=',')
an
r row
yourself. Something like this:
fid = open('somename.csv')
data = numpy.fromfile(fid, sep=',').reshape(-1,6)
# for 6-column data.
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
hat it is not a very sophisticated csv reader (it
only understands a single separator (plus line-feeds are typically seen
as a separator).
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
an easily read space-separated values from a file by reading in a
line at a time and using the split method of strings:
fid = open('filename')
linedata = fid.readlines()
new = [[float(x) for x in line.split()] for line in linedata]
new will be a nested sequence of floats. You can
But, the documentation is old. But, it is still useful (except for
Numeric specific information like how to install it). Therefore we
still make a link to it.
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
numpy-discussion list for better
feedback.
Does it actually segfault or give you this Memory Error?
Temporary arrays that need to be created could be the source of the
extra memory.
Generally, you should be able to use all the memory on your system
(unless you are on a 64-bit system and
NumPy 0.9.8 has been released. It can be downloaded from
http://numeric.scipy.org
The release notes are attached.
Best regards,
-Travis Oliphant
NumPy 0.9.8 is a bug-fix and optimization release with a
few new features. The C-API was changed so that extensions compiled
against
torize handles scalars in recent versions of NumPy. Which version do
you have?
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
-1:1:70j]
ynew = r_[-1:1:70j]
znew = interpolate.bisplev(xnew,ynew,tck)
There is a buglet that is fixed in SVN scipy that means you need to
enter xb, xe, yb, and ye manually.
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
Grant Edwards wrote:
> On 2006-05-27, Travis E. Oliphant <[EMAIL PROTECTED]> wrote:
>
>>> I need to interpolate an irregularly spaced set of sampled
>>> points: Given a set of x,y,z points, I need to interpolate z
>>> values for a much finer x,y gri
> extra options: '-DSCIPY=1'
> gcc: src/_image.cpp
> src/_image.cpp:5:17: png.h: No such file or directory
This is the source of the remaining errors
On my system the "png.h" file comes from a libpng3-devel rpm
Perhaps you need to use apt-get to obtain the development package for png.
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
Grant Edwards wrote:
> On 2006-05-27, Travis E. Oliphant <[EMAIL PROTECTED]> wrote:
>
>> Not that you made a bad choice. I do wonder, how much of your
>> difficulty was with the interface to the underlying fitpack
>> routines.
>
> I've no idea. I ha
Travis Vaught wrote:
Greetings,
The Texas Python Regional Unconference is coming up this weekend
(October 4-5) and I wanted to send out some more details of the
meeting. The web page for the meeting is here:
http://www.scipy.org/TXUncon2008
The meeting is _absolutely free_, so please add
up.py though, there is no need).
After copying the files over to your site-packages directory, just start
python and do
import numpy
-Travis
--
http://mail.python.org/mailman/listinfo/python-list
#x27;t figure it out how
to do again.
Any help?
--
Obama Nation | My emails do not have attachments; it's a digital signature
that your mail program doesn't understand. |
http://www.subspacefield.org/~travis/
If you are a spammer, please email j...@subspacefield.org to get blacklist
s, iterators, generators, metaclasses, and the
proliferation of special method names, I have to wonder if that still
holds true... certainly I understand 90+% of python programs, but
do I understand that proportion of the constructs?
PS: Why do people call LISP object-oriented? Are they smoking
inquiry (still ongoing) are here:
http://www.subspacefield.org/~travis/static_blog_generators.html
It's a little disorganized, but does represent a fair amount of work,
and might be a nice intro for a python programmer who isn't up to
his neck in web authoring tools.
Suggestions on how t
should implement the ones with the clearest semantics, and
setresuid fits that bill. To see what an utter mess the uid-manipulation
routines are in, I refer you once again to this paper, as the situation
is too complicated to describe in this email:
http://www.eecs.berkeley.edu/~daw/papers/setuid-us
raise command
won't work in Python 2.6.1; it turns out that os.errno is a module, not
an integer. Does anyone know how to do what I want (that is, how to access
the errno set in C functions)?
--
Obama Nation | My emails do not have attachments; it's a digital signature
that your mail pro
ted the module here:
http://www.subspacefield.org/~travis/python/privilege/
I could sure use any comments people had on my python style.
PyPi link:
http://pypi.python.org/pypi/privilege/1.0
--
Obama Nation | My emails do not have attachments; it's a digital signature
that your mail pr
m also
pretty sure that there's a simple solution, I am just not aware of what
it is.
--
Obama Nation | My emails do not have attachments; it's a digital signature
that your mail program doesn't understand. |
http://www.subspacefield.org/~travis/
If you are a spammer,
201 - 239 of 239 matches
Mail list logo