Skip to content

Instantly share code, notes, and snippets.

@anandtripathi5
Last active February 16, 2022 10:24
Show Gist options
  • Save anandtripathi5/a12d474bd53a2b854277aaac4a3b9c49 to your computer and use it in GitHub Desktop.
Save anandtripathi5/a12d474bd53a2b854277aaac4a3b9c49 to your computer and use it in GitHub Desktop.
Zen of python - Sparse is better than dense
if i>0: return sqrt(i)
elif i==0: return 0
else: return 1j * sqrt(-i)
# Versus
if i > 0:
return sqrt(i)
elif i == 0:
return 0
return 1j * sqrt(-i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment