• SalamanderA
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    Woah, very good tips presented very concisely! I am guilty of many of these.

    I will immediately start using

    with open(filename) as:
    

    and using zip() to synchronize list variables.

    As for PEP8… I will use four spaces for indentation if I intend to share a script with someone, but for personal scripts I always use a single space indentation and I don’t have any issues. Do pros usually stick to the four space rule in python?

  • erpicht@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    I feel called out by this, though I’ve only encountered about half the things on the list. I use Python with numpy and matplotlib.pyplot for data analysis, but apparently do so terribly inefficiently.