python

Back Open Paginator
30.01.2026 17:30
Reuven (@Reuven@fosstodon.org)

I used #Python #Pandas to total AWS S3 payments.

Data was in a CSV file. But numbers in the "Amount" column were written as "USD 12.34".

Here's what I did:

(
df['Amount']
.str.replace('USD', '') # remove "USD"
.astype(float) # no strip needed!
.sum()
)





Show Original Post


30.01.2026 17:22
themediumkahuna (@themediumkahuna@tech.lgbt)

Thought I’d give Polars a try, since I needed to rework some Python code that uses Pandas anyway

Nope. I do not care for the syntax, and the documentation is more opaque than I’d care for. And since it’s newer and less widely known, there aren’t a lot of answered questions already out there

I’ll be sticking with Pandas for the foreseeable future

#Python #Pandas #Polars




Show Original Post


30.01.2026 17:19
reddit_tech_vn_bot (@reddit_tech_vn_bot@mastodon.maobui.com)

Hướng dẫn chi tiết cách huấn luyện mô hình phân đoạn ảnh (instance segmentation) trên dataset tùy chỉnh bằng Detectron2. Bài viết trình bày quy trình từ chuẩn bị dataset COCO, đăng ký dữ liệu, cấu hình mô hình Mask R-CNN, huấn luyện và kiểm tra trực quan. Phù hợp cho dân nghiên cứu AI/Deep Learning muốn áp dụng Detectron2 vào dự án riêng.

#AI #DeepLearning #Detectron2 #MachineLearning #PhânĐoạnHìnhẢnh #InstanceSegmentation #ComputerVision #Python #Dataset #Tutorial

reddit.com/r/pro




Show Original Post


30.01.2026 17:06
jobsfordevelopers (@jobsfordevelopers@mastodon.world)

Nuro is hiring Software Technical Lead, Behavior & Triage Labeling

🔧 #cplusplus #golang #python #techlead
🌎 Mountain View, California
⏰ Full-time
🏢 Nuro

Job details jobsfordevelopers.com/jobs/sof
#jobalert #jobsearch #hiring




Show Original Post


30.01.2026 16:46
YesJustWolf (@YesJustWolf@hachyderm.io)

In #Python, given some kind of bunch of things (a `dict`, a `list`, whatever), but you only want one thing out of it, there are lots of ways to do it:

* All the normal things: the first one, the last one, some specific index, using a key, whatever (appropriate for almost every case where the bunch of things is some kind of `Mapping`)
* When you need to search, e.g., it's not just the first one, it's the first one such that it satisfies some predicate `p`. I posted on this a bit ago (see hachyderm.io/@YesJustWolf/1158):

`next(e for e in bunch if p(e))`,
`next(e for e in bunch if p(e), None)`

But what if there's only one thing in the bunch. And for mappings, you don't happen to know the key of that one thing (nor do you need to know).

* `bunch[0]`: ugly and a bit magic to my eye because it contains a number (the key you explicitly don't care about)
* `bunch.pop()`: I personally find this slightly better (and it works on more things), but it modifies `bunch` and like the expression above, doesn't express your knowledge that `len(bunch)==1`
* Yes, the `next` method I mention above works here, but it's way more work and visual noise

Destructuring assignment does exactly what I want. Imagining `bunch` to be a dictionary where I want to get the value of the one and only item in it, but without modifying the `dict`:

`(v,) = bunch.values()`

That clearly explains that I know there's only one. Works even though I don't know the key of that one item (yes, it would have been easy enough to find, but I don't care here).




Show Original Post


30.01.2026 16:34
tohuwabohu (@tohuwabohu@techhub.social)

I'm sure similar tools exist, but I had fun buidling a resume generator that creates a PDF from YAML data, styled with HTML + CSS.

github.com/thwbh/curricu-loom

#python #resume #cv #resumeTemplates




Show Original Post


30.01.2026 16:31
bterwijn (@bterwijn@fosstodon.org)

Teaching data structures in Python gets easier with 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵 visualizations. Data structures are no longer abstract concepts but concrete, clear and easy to debug.

Hash_Map demo: memory-graph.com/#codeurl=http

This Hash_Map (Hash_Table) is a Python implementation similar to 'dict'. The demo visualizes:
- adding key–value pairs
- rehashing
- lookup by key
- iterating over keys

#Python #programming #memory_graph





Show Original Post


30.01.2026 16:25
YesJustWolf (@YesJustWolf@hachyderm.io)

My day job is all about #Python (which I love). Here are some personal rules, specific to working with Python projects:

* Do **not** install or modify global tools, especially Python itself or any packages. This means a given system might not even **have** a global Python
* Always use virtual environments (`uv` agrees with me, and doesn't need this but). I always set the global environment variable `PIP_REQUIRE_VIRTUALENV`.
* The two rules above mean my virtual environment contains (not via a link, it's really there) Python itself (and of course, of the right version)
* Virtual environments always live **inside** a project directory. Never global.
* Activate virtual environments only **inside** the project directory (`direnv` #direnv makes this easy)
* Don't install (let alone use) #Anaconda, #Miniconda, or #Mamba, because those violate all the rules above (but see the next rule)
* Anaconda-based packages implies a `pixi` #Pixi project (it's the same people, but a better answer, and you still get what you want -- the correct packages)
* No Anaconda-based packages implies a `uv` #UV project
* Always use `pyproject.toml` #pyprojecttoml over any other config file (e.g., `requirements.txt #requirementstxt), except where things just don't work, such as needing `pyrefly.toml`
* `uv`, `pixi`, and `direnv` must exist outside of any project, so install them at the user level, or else globally if and only if that is appropriate and compelling enough to override rule one

That was a wall of text, but in practice doing it this way is trivial. It's probably **less** work than you have been doing. This post is just about managing your Python versions, environments, and projects. Not about, e.g., using `pre-commit` #precommit, or doing type checking, etc. But if you follow these rules, your work will be easier, faster, more adaptable, and encounter fewer obstacles.

#HotTo




Show Original Post


30.01.2026 16:24
bbelderbos (@bbelderbos@fosstodon.org)

Your favorite #Python 🐍 libraries are lying to you.

• `pip install orjson` - that's Rust.
• `pip install polars` - Rust.
• `pip install cryptography` - Rust.
• `pip install pydantic` - the core is Rust.
• `pip install ruff` - Rust again. 




Show Original Post


30.01.2026 16:20
reddit_tech_vn_bot (@reddit_tech_vn_bot@mastodon.maobui.com)

🛠️ Đã ra mắt CODED FLOWS – công cụ kéo‑thả Python trực quan, biến code AI thành các block tái sử dụng. Người dùng có thể kéo‑thả, chia sẻ package (ML, query DB, chuẩn dữ liệu) và xuất ra script Python. Giúp giảm việc viết lại mã lặp lại trong các dự án nội bộ. #CodedFlows #AI #Python #NoCode #Automation #CôngCụ #LậpTrình #DataTools

reddit.com/r/SideProject/comme




Show Original Post


30.01.2026 16:03
ubuntu_touch (@ubuntu_touch@mstdn.social)

Gráfico de imagen con histograma en la parte superior

#Matplotlib #Python
Analizar la distribución de características en mapas de calor #ML #AprendizajeAutomatico
#Anzoategui #Lecheria





Show Original Post


30.01.2026 15:58
Olly42 (@Olly42@nerdculture.de)

:raspberrypi: Engine Data displayed live on Dash.

In the auto world, there are lots of overarching standards that all automakers comply with. There are also lots of proprietary technologies that each automaker creates and uses for its own benefit. [Shehriyar Qureshi] has recently been diving into Suzuki’s Serial Data Line standard, and has created a digital dash using the data gained.

github.com/thatdevsherry/suzui

#suzuki #digital #engine #data #dash #display #diy #engineer #media #python #rust #programming #car #tech #raspberrypi #news





Show Original Post


1 ...562 563 564 565 566 567 568 569 570 571 572 ...1587
UP