Search:

Type: Posts; User: Erdaron; Keyword(s):

Page 1 of 9 1 2 3 4

Search: Search took 0.02 seconds.

  1. Re: How to resolve a variety of possible inputs

    Well, to be honest, I am not actually sure what I expect. This brute force way of just decision-treeing my way through is straightforward, and there is certainly value in that. But maybe someone has...
  2. How to resolve a variety of possible inputs

    I have a kind of general question. I'm writing a function that has a sole output, but may be supplied a variety of inputs, and I'm wondering to handle this in an elegant or proper manner.

    Here is...
  3. Replies
    8
    Views
    1,026

    Re: Ubuntu 12.04, Python and serial data.

    I'm learning pySerial right now, too. In my experience so far, flushing the buffer is not necessary to send the data to the device.

    In the examples you've seen, is the write command immediately...
  4. Re: Help using python multiprocessing for edit distance calculation

    I do simulations in quantum optics, and multiprocessing has been wonderful. An easy way to set it up:

    import multiprocessing
    pool = multiprocessing.Pool()
    results = pool.map_async(distance,...
  5. Replies
    28
    Views
    4,469

    Re: I'm having a hard time learning python.

    I agree - learning in the abstract is hard for me, too. Writing code to address problems you actually care about is much better motivation. Fortunately for me, my job gives me plenty of opportunities...
  6. Re: Do you think for each app idea you think off, which already exists, is waste of t

    First, "best" is a notoriously squishy parameter. However, looking at a lot of software out there, it seems there is a bunch that doesn't even fulfill its own goals and ideals. If the execution of...
  7. Re: What makes a good coder-what is the secret of programming ?

    Like many have stated above, you become good by coding. A lot. And then coding some more. Programming is very much like a human language - the purpose is to express ideas in a clear and nuanced way,...
  8. Re: [Python] Unsigned 64-bit integer causing addressing error

    So I wanted to check if it was indeed reading garbage bytes or out of place bytes if I was using unsigned 64-bit integers for specifying the address.

    First, I parked the pointer at the last record...
  9. Re: [Python] Unsigned 64-bit integer causing addressing error

    I haven't noticed anything especially odd going on with the data coming from the tail of the file. Nothing like garbage of flat-lining. At worst, it probably just starts reading at the beginning. But...
  10. Re: [Python] Unsigned 64-bit integer causing addressing error

    Ho-hum. So if there is an overflow that somehow goes silent, it should just start reading from the beginning of the file again, right?
  11. Re: [Python] Unsigned 64-bit integer causing addressing error

    Here is the relevant part of the class and method definition:

    class TESstream1:
    #Objects of this class allow loading and searching data from a
    # a binary file containing single-channel...
  12. Re: [Python] Unsigned 64-bit integer causing addressing error

    I thought this might be a problem, but the values I use are too small to run into that boundary. I'm at the point where a 32-bit integer just barely doesn't cover it. 63- and 64-bits provide far more...
  13. Re: [Python] Unsigned 64-bit integer causing addressing error

    Thank you for the suggestion!

    I don't think calling ids[] with a negative index is the issue. In Python, using the negative index simply means counting backwards from the end of the array.

    The...
  14. [Python] Unsigned 64-bit integer causing addressing error

    I am working with large binary files (several gigabytes each), and I need to be able to address specific bytes in those files. So I keep addresses of data within these files using 64-bit integers,...
  15. Replies
    5
    Views
    985

    [SOLVED] Re: [Python] Unzipping a large list

    When I was using memmap, it read the source file just fine, but garbled the data when writing it to the new file. Basically, everything before the offset marker would be zeroed out.

    I ended up...
  16. Replies
    5
    Views
    985

    [SOLVED] Re: [Python] Unzipping a large list

    Thank you, again, for the great advice. I have a couple follow-up questions.

    In the numpy documentation, there is a note that the memmap objects cannot exceed 2 GB in size. How would I get around...
  17. Replies
    5
    Views
    985

    [SOLVED] [Python] Unzipping a large list

    I'm working with some large data files (several gigabytes) that store interleaved data from several channels: first value from channel A, first value from channel B, second value from channel A,...
  18. Thread: MatLab

    by Erdaron
    Replies
    5
    Views
    303

    Re: MatLab

    Depending on what you need to do, Python with numpy and scipy can be a handy substitute for Matlab. No symbolic manipulation, really, but number crunching to your heart's content. Lots of linear...
  19. Re: read multiple files in Python omitting certain characters from the filenames

    Seems like a good application for regular expressions.

    Without using regex, you could do something like this:


    hh = '01' #set the hour, as string
    flist = os.listdir(os.getcwd()) #get the list...
  20. Replies
    3
    Views
    3,659

    [SOLVED] Re: [Python] Reading large binary data files

    Of course. Thank you :). It's embarrassing that I somehow overlooked its function, even though I found its cousin.
  21. Replies
    3
    Views
    3,659

    [SOLVED] Re: [Python] Reading large binary data files

    Never mind, I'm an idiot. Apparently I just needed to add the binary flag 'b' to the .read() method. The correct call to read the file:


    >>> f1 = open('T_03.dat', 'rb')
    >>> a1 = f1.read()
    >>>...
  22. Replies
    3
    Views
    3,659

    [SOLVED] [Python] Reading large binary data files

    I am working on a data analysis script that is supposed to read in a large (hundreds of megabytes) data file. The data are encoded as a single row of unsigned 16-bit integers (uint16 ieee-le).

    For...
  23. Replies
    7
    Views
    1,511

    [SOLVED] Re: [Python] Threads colliding, garbling output

    Thank you, using .close() followed by .join() worked exactly as I had wanted. I at first assumed that using del on the pool object would automatically call something similar to these methods, but it...
  24. Replies
    7
    Views
    1,511

    [SOLVED] Re: [Python] Threads colliding, garbling output

    I have started playing with the multiprocessing, and it certainly works, but there are a couple of oddities I wanted to ask about:

    Every time I call the multiprocessing version of the function, it...
  25. Replies
    7
    Views
    1,511

    [SOLVED] Re: [Python] Threads colliding, garbling output

    Thank you for pointing me in this direction! I saw the multiprocessing module, but for some reason decided to start with threading. But this looks just like the thing.

    My code is pure Python...
Results 1 to 25 of 202
Page 1 of 9 1 2 3 4