[Numpy-discussion] diferences between frompyfunc & vectorize

2013-10-27 Thread Tim Michelsen
Hello, what are the differences between the two transformation functions frompyfunc & vectorize * http://docs.scipy.org/doc/numpy/reference/generated/numpy.vectorize.html * http://docs.scipy.org/doc/numpy/reference/generated/numpy.frompyfunc.html I cannot see the which one I shall prefer for what

Re: [Numpy-discussion] printing structured arrays

2010-03-09 Thread Tim Michelsen
>> Is this worth to go into the official docs? >> The page http://docs.scipy.org/doc/numpy/user/basics.rec.html is quite >> sparse... >> >> I still wonder why there is not a quick function for such a view / >> reshape conversion. > > > Thanks, the docs for working with arrays with structured dtyp

Re: [Numpy-discussion] printing structured arrays

2010-03-09 Thread Tim Michelsen
josef.p...@gmail.com schrieb: > On Mon, Mar 8, 2010 at 5:50 PM, Tim Michelsen > wrote: >> Hello, >> thanks to all who responded and have their input here. >> >> I added a little code snippet to show the view and reshape: >> >> http://www.scipy.org/Cookbo

Re: [Numpy-discussion] printing structured arrays

2010-03-09 Thread Tim Michelsen
>> I still wonder why there is not a quick function for such a view / >> reshape conversion. > > Because it is difficult (impossible?) to do in the general case. .view() > really isn't that bad, in fact, it remarkably powerful and flexible! I would not drop .view() but rather add a convenience fu

Re: [Numpy-discussion] printing structured arrays

2010-03-09 Thread Tim Michelsen
Hello, thanks to all who responded and have their input here. I added a little code snippet to show the view and reshape: http://www.scipy.org/Cookbook/Recarray What do you think? Is this worth to go into the official docs? The page http://docs.scipy.org/doc/numpy/user/basics.rec.html is quite s

Re: [Numpy-discussion] printing structured arrays

2010-03-08 Thread Tim Michelsen
Hello, I am also looking into the convertsion from strcutured arrays to ndarray. > I've just started playing with numpy and have noticed that when printing > a structured array that the output is not nicely formatted. Is there a > way to make the formatting look the same as it does for an unstruct

[Numpy-discussion] numpy1.4 dtype issues: scipy.stats & pytables

2010-01-11 Thread Tim Michelsen
Hello, I experienced the following issue with numpy 1.4: scipy.stats: Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 import scipy.stats as st Traceback (most recent call last): File "", line 1, in File "C:\Python26\lib\site-packages\scipy\stats\__init

Re: [Numpy-discussion] Numpy savetxt: change decimal separator

2009-09-24 Thread Tim Michelsen
>> And another question I import this file to excel, is there also a >> possiblity to create a headline for each column, that the file looks >> like the following example: >> >> average; standard deviation; maximum distance; sum of distances >> 0,26565; 0,65565; 2,353535; 25, 5656 I was fid

[Numpy-discussion] current stautus of numpy -> Excel

2009-09-23 Thread Tim Michelsen
FYI: Here is a summary of how one can 1) write numpy arrays to Excel 2) interact with numpy/scipy/... from Excel http://groups.google.com/group/python-excel/msg/3881b7e7ae210cc7 Best regards, Timmie ___ NumPy-Discussion mailing list NumPy-Discussion@

Re: [Numpy-discussion] online Doc Editor [Re: `missing` argument in genfromtxt only a string?]

2009-09-15 Thread Tim Michelsen
> My bad, sorry. I already always forget to check tickets on the trac > site for numpy/scipy, adding yet another site to check seems to be way > too much for my caffeine-affected memory. However, there should be an > option to allocate tickets to specific people, right ? And then I > should

Re: [Numpy-discussion] online Doc Editor [Re: `missing` argument in genfromtxt only a string?]

2009-09-15 Thread Tim Michelsen
> It already exists in the docs: > http://docs.scipy.org/numpy/docs/numpy.lib.io.genfromtxt/ > Did you mean you tried to edit this page? But cannot be found in here: http://docs.scipy.org/doc/numpy/reference/routines.io.html So it just needs to be added in http://docs.scipy.org/doc/numpy/_source

Re: [Numpy-discussion] `missing` argument in genfromtxt only a string?

2009-09-15 Thread Tim Michelsen
> I actually figured out a workaround with converters, since my missing > values are " "," "," " ie., irregular number of spaces and the > values aren't stripped of white spaces. I just define {# : lambda s: > float(s.strip() or 0)}, and I have a loop build all of the converters, > but then I h

Re: [Numpy-discussion] `missing` argument in genfromtxt only a string?

2009-09-15 Thread Tim Michelsen
> Check the archives of the mailing list, there's an example using > dateutil.parser that may be just what you need. How is this dateutil.parser used in timeseries? Can it not be used to make the dateconverter obsolte for the most simple cases? ___ Nu

[Numpy-discussion] online Doc Editor [Re: `missing` argument in genfromtxt only a string?]

2009-09-15 Thread Tim Michelsen
> I just wanted to point out that there is an easy way of making a > difference, and making sure that the docstrings get fixed (which is > indeed very important). If you go to http://docs.scipy.org/ and register, > send your login name on this mailing list, we will add you to the list of > editors,

Re: [Numpy-discussion] help creating a reversed cumulative histogram

2009-09-03 Thread Tim Michelsen
>> Again, would a function for the >> "empirical inverse survival function" qualify for the >> inclusion into numpy or scipy? > > Sorry, I'm too distracted, correcting myself a second time > "this should *not* have inverse in it, using inverse was a cut and paste > error" > it's empirical survi

Re: [Numpy-discussion] help creating a reversed cumulative histogram

2009-09-03 Thread Tim Michelsen
> My first stop is usually wikipedia: [...] Thanks. So I I'known that I have to call the beast a "empirical inverse survival function", Robert would also have foundit easier to help. Anyway, step by step... > In the case of the weight of pigs, it would be to cumulative weight of > all pigs with

Re: [Numpy-discussion] help creating a reversed cumulative histogram

2009-09-03 Thread Tim Michelsen
> Hello, I have checked the snippets you proposed. It does what I wanted to achieve. Obviously, I had to substract the values as Robert demonstrated. This could also be perceived from the figure I posted. I still have see how I can optimise the code (c.f. below) or modify to be less complicated

Re: [Numpy-discussion] help creating a reversed cumulative histogram

2009-09-03 Thread Tim Michelsen
> >>> Okay. That is completely different from what you've asked before. > > You are right. > > But it's soemtimes hard to decribe a desired and expected output in > > python terms and pseudocode. > > I still have to lern more numpy vocabs... > > Actually, I apologize. I meant to delete that line b

Re: [Numpy-discussion] help creating a reversed cumulative histogram

2009-09-02 Thread Tim Michelsen
Hello Robert and Josef, thanks for the quick answers! I really appreciate this. >>> I am trying to create a inverse cumulative histogram [3] which shall >>> look like [4] but with the higher values at the left. >> Okay. That is completely different from what you've asked before. You are right. But

[Numpy-discussion] help creating a reversed cumulative histogram

2009-09-02 Thread Tim Michelsen
Hello fellow numy users, I posted some questions on histograms recently [1, 2] but still couldn't find a solution. I am trying to create a inverse cumulative histogram [3] which shall look like [4] but with the higher values at the left. The classification shall follow this exemplary rule: cl

[Numpy-discussion] np.hist with masked values

2009-09-01 Thread Tim Michelsen
Hello, should creating a histogram with masked data be different that one cretated with unmasked data? Is np.hist tuned for work with historams? I R_project I would do: # Note: values is my dataset ### masking zeros values_mask=ifelse(values==0, NA, (values)) # http://stat.ethz.ch/R-manual/R-pa

Re: [Numpy-discussion] genfromtext advice

2009-09-01 Thread Tim Michelsen
> But I completely agree with you, genfromtxt could print out > the line number and the actual line giving problems. Here we go: http://projects.scipy.org/numpy/ticket/1212 ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scip

Re: [Numpy-discussion] genfromtext advice

2009-09-01 Thread Tim Michelsen
> $ awk -F '|' '{if(NF != 12) print NR;}' /tmp/pp.txt > and besides the first 23 lines and the last 3 lines of the file, > also the following have a number of '|' different from 11: > 1635 > 2851 > 5538 > i.e. BIKIN, BENGUERIR and TERESINA AIRPORT. Looks lika some bash magic. I will try to transla

Re: [Numpy-discussion] genfromtext advice

2009-09-01 Thread Tim Michelsen
> Mmh, perhaps. Thanks for the quick reply. > I'll try to see what I can do. Usually, this message > shows up when one of the lines you have read doesn't have the same > number of columns as the others. Could we add this error to the docstring? As I suggested, It would be helpful to get the l

[Numpy-discussion] genfromtext advice

2009-09-01 Thread Tim Michelsen
Hello, I tried to load a ASCII table into a string array. Unfortunately, this table has some empty chells Here it is: http://www.ncdc.noaa.gov/oa/climate/rcsg/cdrom/ismcs/alphanum.html After having converted this into a text file I tried this: $ np.genfromtxt('alphanum_to-text.txt', dtype=np.str

Re: [Numpy-discussion] histogram: sum up values in each bin

2009-08-27 Thread Tim Michelsen
> Tim, do you mean, that you want to apply other functions, e.g. mean or > variance, to the original values but calculated per bin? Sorry that I forgot to add this. Shame. I would like to apply these mathematical functions on the original values stacked in the respective bins. For instance: The

[Numpy-discussion] histogram: sum up values in each bin

2009-08-27 Thread Tim Michelsen
Hello, I need some advice on histograms. If I interpret the documentation [1, 2] for numpy.histogram correctly, the result of the function is a count of the occurences sorted into each bin. (n, bins) = numpy.histogram(v, bins=50, normed=1) But how can I apply another function on these values stac

Re: [Numpy-discussion] [OFFTOPIC] Reference management for articles

2009-06-10 Thread Tim Michelsen
> http://bibdesk.sourceforge.net/ I use JabRef for quite some time. Very nice and cross-platform. Good interoperability with LyX. If you with MS or OOo, you'd go for Bibus. Best regards, Timmie ___ Numpy-discussion mailing list Numpy-discussion@scipy.

Re: [Numpy-discussion] Registering numpy on Pypi

2009-04-05 Thread Tim Michelsen
to mention that I could not register the 1.3.0 release on pypi, > as I don't have rights to the numpy project. The release is tagged, so > it is just a matter of running python setup.py register for anyone with > corresponding privileges on pypi's numpy project, Sorry, I should have read here first

Re: [Numpy-discussion] Ironclad 0.8 released

2009-01-29 Thread Tim Michelsen
Hello William, once again. I just noticed that Resolver One can only import data from Excel. In science, the common low level data exchange format is ASCII text like: CSV or tab separated. You may consider adding this. I did not find any installation instructions contained in the docs for the

Re: [Numpy-discussion] Ironclad 0.8 released

2009-01-29 Thread Tim Michelsen
Hello William, > * A few performance improvements. > * Over 900 NumPy tests now pass: in fact, almost all the tests from the > core, fft, lib, linalg, ma, oldnumeric and random subpackages. I have some questions here for the science interested. I hope that they are not too specific: * Can you a

Re: [Numpy-discussion] coding style: citations

2009-01-23 Thread Tim Michelsen
Hello Allan, Stefan and others, did you already come to a conclusion regarding this cite topic? Did you try to run the bibtext extension for Sphinx? If so, please update the documentation guidelines. Regards, Timmie ___ Numpy-discussion mailing list N

Re: [Numpy-discussion] Please don't use google code for hosting

2009-01-20 Thread Tim Michelsen
Hello, last year there has been a discussion on this on the OSGEO list about the same issue. You may check oggeo.discuss at Gmane or Nabble for it. Kind regards, Timmie ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy

Re: [Numpy-discussion] coding style: citations

2009-01-13 Thread Tim Michelsen
> If I understand, you are using bib4txt.py to do this? Yes, I use bib4txt.py. The extension just runs bib4txt.py over all documents to extract the citations. Then it creates the reference file. The bibtex file is also converted to ReSt using your tools. But since the bibstuff needs the citation

Re: [Numpy-discussion] coding style: citations

2009-01-13 Thread Tim Michelsen
Hello, I really like the discussion here. > Originally I was just pointing out a problem. > Proposing a good solution requires some discussion. > The problem has also changed because of a suggestion > that the docs should be usable for book compilation, > and I am very uncertain how that is conce

Re: [Numpy-discussion] Apply a function to an array elementwise

2008-12-04 Thread Tim Michelsen
>> I want to apply a function (myfunc which takes and returns a scalar) to each >> element in a multi-dimensioned array (data): >> >> I can do this: >> >> newdata = numpy.array([myfunc(d) for d in data.flat]).reshape(data.shape) >> >> But I'm wondering if there's a faster more numpy way. I've looke

Re: [Numpy-discussion] Reference guide updated

2008-07-22 Thread Tim Michelsen
> A new copy of the reference guide is now available at > > http://mentat.za.net/numpy/refguide/ Very nice. Will this be included in the main numpy distribution upon completion? Thanks and appreciation for efforts. Kind regards, Timmie ___ Numpy-disc

[Numpy-discussion] proposal: add a header and footer function to numpy.savetxt

2008-07-17 Thread Tim Michelsen
Hello, sometime scripts and programs create a lot of data output. For the programmer and also others not involved in the scripting but in the evaluation of the output it would be very nice the output files could be prepended with a file header describing what is written in the columns below and to

[Numpy-discussion] Tip: Backporting the latest numpy release in Ubuntu Hardy (8.04)

2008-07-07 Thread Tim Michelsen
Hello, due to fixed release cycles Ubuntu 8.04 still lacks the latest numpy 1.1. I succeeded backporting the package python-numpy from the upcoming release Intrepid 8.10 with the help of the automatic tool Prevu. Instructions can be found here: * https://wiki.ubuntu.com/Prevu * http://ubuntuforu

[Numpy-discussion] removing and replacing certain values in arrays

2008-07-07 Thread Tim Michelsen
Hello, how do I remove all rows (or column) from an array which contain a certain value or sting? some like: array.delte_row_from_array_wich_contains('March') array.delte_row_from_array_wich_contains(-333) Is there also possibility to replace all occurences of a certain value in a array by n

Re: [Numpy-discussion] Py3K

2008-04-16 Thread Tim Michelsen
> This looks like something that need to go on a list for numpy 1.2. Can you post a list of the specific problems that need to be addressed?Chuck Maybe this post can give some hints: All Things Pythonic Python 3000 and You by Guido van Rossum March 17, 2008 Summary I've posted the slides f

[Numpy-discussion] Scipy and Numpy at Nabble Forums

2008-04-07 Thread Tim Michelsen
Hello, I registered the Scipy and Numpy mailing lists at the Nabble Web Forums: Scipy http://www.nabble.com/Scipy-User-f33045.html Numpy http://www.nabble.com/Numpy-discussion-f33046.html I still have to import the old emails from the archives. Kind regards and happy communicating, Tim

[Numpy-discussion] loading data with gaps

2008-04-03 Thread Tim Michelsen
Hello! How can I load a data file (e.g. CSV, DAT) in ASCII which has some gaps? The file has been saved with from a spreadsheet program which leaves cells with not data empty: 1,23. 2,13. 3, 4,34. Would this code be correct: ### test_loadtxt.py ### import numpy import maskedarray # load data

Re: [Numpy-discussion] setting items in a matrix

2007-12-23 Thread Tim Michelsen
> To learn array basics: > http://pages.physics.cornell.edu/~myers/teaching/ComputationalMethods/python/arrays.html> > http://www.scipy.org/Numpy_Example_List#head-a8a8874581c2ebfc69a37ab513974a229ff3bfaa> > http://www.scipy.org/Numpy_Example_List#head-a261b8dd10bda6a5fc268fe4f4171acee2f83968> > ht