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

Page 1 of 9 1 2 3 4

Search: Search took 0.01 seconds.

  1. [SOLVED] Re: [Python numpy] Ambiguity with numerical type casting

    Thank you for walking this reasoning all the way home for me. I think I've gotten lazy with type-checking in Python. This is a good lesson to be careful.
  2. [SOLVED] [Python numpy] Ambiguity with numerical type casting

    I ran into an issue where numpy's numerical types don't seem to be well-behaved. Consider the following sequence of commands:

    >>> type(np.uint64(5))
    <type 'numpy.uint64'>
    >>> type(np.uint64(5) +...
  3. 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...
  4. 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...
  5. Replies

    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...
  6. 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,...
  7. Replies

    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...
  8. 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...
  9. 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,...
  10. 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...
  11. 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...
  12. 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?
  13. 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...
  14. 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...
  15. 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.

  16. [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,...
  17. Replies

    [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...
  18. Replies

    [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...
  19. Replies

    [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,...
  20. Thread: MatLab

    by Erdaron

    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...
  21. 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...
  22. Replies

    [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.
  23. Replies

    [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 =
  24. Replies

    [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).

  25. Replies

    [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...
Results 1 to 25 of 204
Page 1 of 9 1 2 3 4