🔍  

Physician exploring the intersection of technology and medicine 🤖 🔭 🩺

main site: loysharosen.com

2026-06-11

Back in Scrubs

Last week, I returned to my mandatory clinical internship at Karolinska University Hospital, after a wonderful seven month stint as stay-at-home dad. First stop - the emergency department.

I got curious and managed to find statistics on number of visits by diagnosis groups at the ED. I whipped up a plot and ran it through Claude Code for polish:

graphs/top_10_dx.png

Show more

2026-05-06

I've been on the lookout for a way to maintain my coding skills and simultaneously apply my maths knowledge. I found it!

projecteuler.net

Project Euler provides mathematical problems that require a computer and programming to be solved. For example, in order to even register for the site, one must solve the following problem:

A number is a perfect square, or a square number, if it is the square of a positive integer.

For example, 25 is a square number because 5^2=5 \times 5=25; it is also an odd square.

The first 5 square numbers are: 1,4,9,16,25, and the sum of the odd squares is 1+9+25=35.

Among the first 290 thousand square numbers, what is the sum of all the odd squares?

Show more

2026-03-23

The Python Ternary Operator

My most recent Python dicovery is the ternary operator.

The ternary operator returns one of two values, based on the truthiness of a Boolean expression.

value_if_true if boolean_expression else value_if_false

Here's an example without the ternary operator, using an if-statement.

def odd_or_even(x):
    if x % 2:
        return "Odd"
    else:
        return "Even"

Here's the same function, using the ternary operator.

Show more