On Fri, 01 Aug 2014 12:45:12 +, Alex van der Spek wrote:
> With a dict like so:
>
> cond = {'a': 1, 'b': 1, 'c': 1,
> 'A': 0, 'B', 0, 'C':0}
>
> how would you make a boolean expression like
With a dict like so:
cond = {'a': 1, 'b': 1, 'c': 1,
'A': 0, 'B', 0, 'C':0}
how would you make a boolean expression like this:
bool = (('a' == 1) & ('A' == 0) |
('b' == 1) & ('B' == 0) |
('c' == 1) & ('C' == 0))
The fact that lowercase and uppercase keys are stringed tog
Many hours later I found a working solutions in ctypes:
The below makes sense to me but I am still at a loss why the first solution
did not work.
Anybody willing to explain for my better understanding?
Regards,
Alex van der Spek
_snns
rint outdat
+++
This executes but leaves the outdat array unchanged.
Obviously I haven't understood ctypes well enough.
Returning arrays from FORTRAN I routinely do through a string_buffer.
That works very well but did not work here at all.
Any and all help we
On Wed, 12 Mar 2014 10:00:09 -0500, Zachary Ware wrote:
> On Wed, Mar 12, 2014 at 9:25 AM, Alex van der Spek
> wrote:
>> I think I understand the difference between deep vs. shallow copies but
>> I was bitten by this:
>>
>> with open(os.path.join('path',
ppend does complete. The below works:
with open(os.path.join('path', 'foo.txt', 'rb') as txt:
reader = csv.reader(txt)
data = [row + [year] for row in reader]
However in this context I am baffled. If someone can explain what is
going on here, I would be m
have done that for a number of the dierckx routines. No problems at all.
Hope this helps,
Alex van der Spek
> On Wednesday, April 24, 2013 11:13:45 AM UTC+2, Roozbeh wrote:
>> Hi all, I want to use spline interpolation function from SciPy in an
>> application and at the same tim
is a
comma.
Can I change the comma (,) into a period (.) and if so how?
Thanks in advance,
Alex van der Spek
--
http://mail.python.org/mailman/listinfo/python-list
rator is a
comma.
Can I change the comma (,) into a period (.) and if so how?
Thanks in advance,
Alex van der Spek
--
http://mail.python.org/mailman/listinfo/python-list
x27;)
ignorethat = igg(ddftopdir, os.listdir(ddftopdir))
ignorethat
set(['Chi2.png', 'DTSdata.hdf', 'TST.hdf', 'BullNoseDiffs.png',
'DTSall.hdf', 'Symmetry.pdf'])
Why does it fail on passing in a tuple of ignore strings? I thought the ,
On Sat, 19 May 2012 01:59:59 +, Steven D'Aprano wrote:
> I have matplotlib and iPython, and want to plot a function over an
> equally-spaced range of points.
>
> That is to say, I want to say something like this:
>
> plot(func, start, end)
>
> rather than generating the X and Y values by ha
I do not understand why the spooled write gives an error. See below.
The normal tempfile works just fine. They are supposed to behave equal?
All insight you can provide is welcome.
Alex van der Spek
+
Python 2.7.1 (r271:86832, Nov 27 2010, 18:30
I am confused about the Wave_write object setsampwidth(n).
Is the sample width n the total sample width, i.e. for a stereo sample
consisting of short (2 byte) integers; n=4 or is the sample width the number
of bytes in either the left or the right channel?
Regards,
Alex van der Spek
When reading a tree and writing it back to a new file all the elements are
prepended with the string ns0:
Why is it prepended and how can I suppress this?
Thanks,
Alex van der Spek
--
http://mail.python.org/mailman/listinfo/python-list
cted a readable buffer object
But this does:
dat=[(1,2,3),(4,5,6)]
arr=numpy.array(dat,dtype=col)
arr
array([(1.0, 2.0, 3.0), (4.0, 5.0, 6.0)],
dtype=[('a', '
The only difference that the object is a list of tuples now?
Thanks for clarification,
Alex van der Spek
--
http://mail.python.org/mailman/listinfo/python-list
Is there an equivalent to os.path.walk() for HDF5 file trees accessed
through h5py?
Thanks!
Alex van der Spek
--
http://mail.python.org/mailman/listinfo/python-list
reading a few lines. I
tried on Linux and Windows. I use the standard binaries as distributed.
Thanks in advance,
Alex van der Spek
--
http://mail.python.org/mailman/listinfo/python-list
possibilities? Is it the same across platforms (I use Python
2.7 on Win Vista)?
See code below.
Thanks for the insight!
Alex van der Spek
+++
from Tkinter import *
import tkFileDialog as tkf
tkroot=Tk()
tkroot.withdraw()
initdir=os.environ['HOME']
filetype=[(
able. There does not
appear to be a way to multiselect files?
I am probably missing a whole lot. Please point me to a simple example of
GUI file manipulations. I can save myself with os.path.walk and os.listdir
but the users I try to serve cannot.
Regards,
Alex van der Spek
--
http://mai
Thank you! Would never have found that by myself.
"Paul Rubin" wrote in message
news:7x7ha75zib@ruckus.brouhaha.com...
"Alex van der Spek" writes:
refd=dict.fromkeys(csvr.fieldnames,[]) ...
I do not understand why this appends v to every key k each time.
You ha
row.items():
refd[k].append(v)
I do not understand why this appends v to every key k each time.
Thanks in advance for any tips you can pass on.
Alex van der Spek
--
http://mail.python.org/mailman/listinfo/python-list
eally idle.
>>> dva.terminate()
however does work fine and kills the program as it should.
Is there a way or do I have to go back to Visual Basic?
Regards,
Alex van der Spek
--
http://mail.python.org/mailman/listinfo/python-list
in Python. The fact that I still use and can use FORTRAN
gives away my age. Mixed language programming is not an issue for me (C/VB,
VB/FORTRAN, C/FORTRAN) but Python is new. Just pointing me to relevant
documentation would be helpful in its own right.
Thank you in advance,
Alex van der Spek
Thanks all! I understand better now. I had no idea that EOFError was an
exception. I was looking for a function to tell me when the end of a
sequential file is reached as in all of the 4 programming languages that I
do know this is a requirement.
Will modify my program accordingly.
Alex van
tsec=False
fileinput.nextfile()
fn+=1
print fileinput.filename().rsplit('\\',1)[1]
fileinput.close()
+++++++
Regards,
Alex van der Spek
"Alex van der Spek" wrote in messag
blems?
Regards,
Alex van der Spek
"D'Arcy J.M. Cain" wrote in message
news:mailman.2159.1281917130.1673.python-l...@python.org...
On 15 Aug 2010 23:33:10 GMT
Steven D'Aprano wrote:
Under what possible circumstances would you prefer this code to the
built-
in str.join method
you,
Alex van der Spek
--
http://mail.python.org/mailman/listinfo/python-list
group.
If there is, I won't meet it for a while.
Alex van der Spek
"D'Arcy J.M. Cain" wrote in message
news:mailman.2159.1281917130.1673.python-l...@python.org...
On 15 Aug 2010 23:33:10 GMT
Steven D'Aprano wrote:
Under what possible circumstances would you prefer th
Looking for a method that does the opposite of 'split', i.e. elements in a
list are automatically concatenated with a user selectable spacer in between
e.g. '\t'. This is to prepare lines to be written to a sequential file by
'write'.
All hints welcome.
Regards
repositories.
Thanks in advance,
Alex van der Spek
--
http://mail.python.org/mailman/listinfo/python-list
Thanks much, that makes sense! Alex van der Spek
--
http://mail.python.org/mailman/listinfo/python-list
Is there a way to read C# serialized objects into Python?
I know the definition and structure of the C# objects. The Python docs
say that pickle is specific to Python, which does not give me much hope.
There may be a library however that I haven't come across yet.
Thanks much,
Alex va
, have programmed computers
all my life but I won't understand the real tech jargon of present day
computer science. Please keep it simple
Thanks in advance,
Alex van der Spek
--
http://mail.python.org/mailman/listinfo/python-list
33 matches
Mail list logo