Skip to content

Instantly share code, notes, and snippets.

@gggritso
Created September 22, 2025 01:59
Show Gist options
  • Select an option

  • Save gggritso/0aff17a7c12ec2b6a18cbd6c9b8ad6d0 to your computer and use it in GitHub Desktop.

Select an option

Save gggritso/0aff17a7c12ec2b6a18cbd6c9b8ad6d0 to your computer and use it in GitHub Desktop.
Wyatt Trickery
import numpy as np
sq = np.array([
[18005, 18008, 18014, 17998],
[18013, 17999, 18004, 18009],
[18000, 18016, 18006, 18003],
[18007, 18002, 18001, 18015],
])
print(sq.sum(axis=0))
print(sq.sum(axis=1))
print(np.diagonal(sq).sum())
print(np.diagonal(np.fliplr(sq)).sum())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment