15 Cheat Sheet Collection in Python + Git + NumPy + ML + Mindset by Christian Mayer is free with a Leanpub Reader membership! Or you can buy it for $7.99! http://leanpub.com/python-cheat-sheet #DataScience #ComputerProgramming #Ai #FunctionalProgramming #MachineLearning #Python
For around 13 years, I've "maintained" my own Wireworld simulator in #Python. It has become quite a monster. I want to reuse bits of it, but separating them from the main, amorphous mass is difficult. So I have shirked it for- around 13 years... Though it did get converted to Python 3.
I think I might just have to make new code inspired by it.😅
@stylus Maybe look into typing.TypeGuard or its newer alternative typing.TypeIs. They're documented in the stdlib typing module.
IMO casting is also a totally reasonable approach in this situation. Casting is just how you give the type checker information that it can't infer on its own. Obviously not to be overused, but sometimes it's necessary and appropriate.
Need to time how long a short snippet of #python code takes to run? Use the timeit module! 🐍🔥
You can also use timeit to time functions and imports!

I have a Python static typing conundrum. I'd like a solution that works with mypy.
I have a function which fills out a list, albeit not "in order", so it's inconvenient to write it as a list comprehension or similar.
So, I fill the list with [None] and assert that all the Nones are gone by the time it returns.
However, the assertion I wrote does NOT convince mypy that the type of result now matches the return type of f, and I get a diagnostic: Incompatible return value type (got "list[int | None]", expected "list[int]")
def f() -> list[int]:
result: list[int|None] = [None] * 3
result[0] = 1
result[2] = 2
result[1] = 3
assert not any(i is None for i in result)
return result
Any hints? Can I do something besides cast the return value?
#Python #OpenCV w akcji, #PyCharm w trybie #Debug pomaga w wyjaśnianiu...

Dans la suite de mon texte et revue de code sur les technologies RAG. Je suis en train de porter le code #Python du notebook vers des applications #Streamlit en y ajoutant sans doute l'indexation et traitement de l’epub. Je dois dire que les étapes du portage sont très instructives sur la ≠ « travail pour soi vs travail pour les autres. »
One-shotting a prompt with Toad and Gemini to generate a Mandelbrot set.
itch.io da PyGame Oyunu ararken bunu buldum! Trayıcıdan da oynanabiliyor!
Daha geliştirme aşamasında.
*******
Tarayıcınızda Hemen Oynamak İçin Bu Linke Tıklayın: https://hubertrex.github.io/pygame-ce-web-boilerplate/NinjaAdventure/
*******
#PyGame #Python #Game
_______
• Pygame-CE web şablonu: https://hubertnafalski.itch.io/pygame-ce-web-boilerplate
• HubertReX / pygame-ce-web-boilerplate: https://github.com/HubertReX/pygame-ce-web-boilerplate
@diazona I even got Illegal instruction on my test Raspberry Pi with the 13.3 inch e-ink display. But I have found that the Illegal instruction comes from pyarrow and by downgrading it to a version between 20 and 21, the error no longer appears.
I've managed to get my #Python code running without errors again. Only I don't see the #eink display being updated. (I've had that problem with the new 13.3 inch before)
The story continues, because .. it's bedtime again. So small steps every evening.
The ice scraper program is evolving quickly thanks to volunteer excellence. it includes more than 190 facilities and expanding highly detailed detainee data. the scraper- the code #python => https://github.com/Open-Security-Mapping-Project/ice_detention_scraper #ice #dhs #homelandsecurity
S1 EP3 T1 - Machine Learning in Python Split Your Data for Training and Testing #computerscience #machinelearning #codingbasics #mathematics #jupyternotebook #learntocode #coding #vscode #softwareengineer #algorithims #python #dataengineering #softwaredeveloper #artificialintelligence #sql #statistics #datascience #visualstudio #jupyterlabs #linq