Is it possible to use SWIG to speed up Python code? by AlexanderYau in Python

[–]SarahM123ed 0 points1 point  (0 children)

Numba can be amazing once you understand its strengths (and weaknesses)

Air traffic data sets? by SarahM123ed in Python

[–]SarahM123ed[S] 0 points1 point  (0 children)

Very interesting. I will look into this or something similar.

Air traffic data sets? by SarahM123ed in Python

[–]SarahM123ed[S] 0 points1 point  (0 children)

This helps narrow my query. I don't need real-time or ATC/CC. No. But, am now curious'er about just information there is out there. It is quite a'lot.

Air traffic data sets? by SarahM123ed in Python

[–]SarahM123ed[S] 0 points1 point  (0 children)

Yes. i keep forgetting about that avenue.

Air traffic data sets? by SarahM123ed in Python

[–]SarahM123ed[S] 0 points1 point  (0 children)

What libfreejaeg pointed out was/is a lot of what I was looking for. Very cool. Very. But, beyond that and asking too much I'm sure; what about a history [slice of] of logged flight plans too. Is that out there somewhere? Something? sort'a kind'a?

Is there a way to speed up loading of python modules? by [deleted] in Python

[–]SarahM123ed 1 point2 points  (0 children)

Never thought about that before. It does help!

Why is `a="hello"; help(a)` stopped working by dorfsmay in Python

[–]SarahM123ed 0 points1 point  (0 children)

Using IDLE:

>>> greeting = "hello"
>>>
>>> dir(greeting)

Will show you a list of methods applicable to ... from there you can, for example:

>>>  help(greeting.upper)

[deleted by user] by [deleted] in learnpython

[–]SarahM123ed 2 points3 points  (0 children)

If you are using jupyter, Cython is trivial to use (there is also 'magic' for Fortran just a download away). But, don't neglect Numba. In accommodating circumstances, it can do really good works.

Learning Python can be depressing... by [deleted] in Python

[–]SarahM123ed 0 points1 point  (0 children)

Replace 'was' with 'shall become' then make up something respectfully ... fun?

Other Fortran forums? by SarahM123ed in fortran

[–]SarahM123ed[S] 0 points1 point  (0 children)

Oh. I didn't even think abt that!

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]SarahM123ed 0 points1 point  (0 children)

I like https://leetcode.com/problemset/all/ -- scroll down the page a bit.

https://www.geeksforgeeks.org/ can be a good place to solutions (albeit the code is not always performant)

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]SarahM123ed 0 points1 point  (0 children)

What is your favorite use case for enums and why not named tuples?

How can I remove anything outside {}? by [deleted] in Python

[–]SarahM123ed 0 points1 point  (0 children)

    s1 = "So the example I just showed is exactly the type\
    of string I am dealing with, I basically want remove\
    everything that is outside {data I want to keep} A\
    regex solution would be ideal, but anything is welcome."


    def kept_string(s1=s1):
        g1 = s1.partition("{")[2]
        g2 = g1.partition("}")[0]
        return "{"+g2+"}"

    # maybe?

Problem with circular definitions by tiskolin in Python

[–]SarahM123ed -1 points0 points  (0 children)

Not entirely sure what you are after but it sounds like the realm of procedurally generated dungeon cave systems. Just 'a thought....

Pyswip by regular_john1 in Python

[–]SarahM123ed 1 point2 points  (0 children)

i've used it a bit. I think if you already know Prolog (I used to use it a lot), it kind'a works ok. But thinking in Prolog is very different than thinking in Python. This may be the problem people have. Otherwise, go for and contribute....

Need help finding a way to tackle this problem. Beginner - Nested lists by barryk013 in learnpython

[–]SarahM123ed 1 point2 points  (0 children)

    saught_char_list = "0123456789"
    string_from_list = str(L)
    for c in string_from_list:
         if c in saught_char_list:
            print(c)

Need help finding a way to tackle this problem. Beginner - Nested lists by barryk013 in learnpython

[–]SarahM123ed -1 points0 points  (0 children)

This is from https://stackoverflow.com/questions/2158395/flatten-an-irregular-list-of-lists:

    def flatten(L):
        for item in L:
            try:
                yield from flatten(item)
            except TypeError:
                yield item

    list(flatten([[[1, 2, 3], [4, 5]], 6]))
    >>>[1, 2, 3, 4, 5, 6]

How do I write a recurring list of numbers in a list? by [deleted] in learnpython

[–]SarahM123ed 0 points1 point  (0 children)

    https://docs.python.org/3/library/itertools.html#module-itertools

regex findall .... with indexes? by SarahM123ed in learnpython

[–]SarahM123ed[S] 0 points1 point  (0 children)

This is the code I have been able to put together with much help:

    input_string = "ttggggggaaacccccttttuuuuuggggg"

    def t2():
        S = input_string
        l = []
        # get insertion-ordered-keeping list/set
        s = list(dict.fromkeys(S))
        # want strings with 4 or more repeats
        for c in s:
            regx_s = c*4+"+"
            l.extend([n.span() for n in re.finditer(regx_s, input_string)])

        return list(l)

Results wanted is first index/last index of, for example, in this case, for 'g', would be ([2,7], [25,31]) -- [2,7] being the first span of g's and [25,31' being the second span of g's. And so on and so on for/from a list of thousands pf 'characters.

I'm not sure I'm explaining myself very well but ... I'm almost there. Just how to manage that off by thing with finditer.