3 ms·
This program is quick & lazy but it uses a 1D python list and pretends it's a 2D list. It implements 2D slicing, giving you a square subset just like ndarray. I
by kzrdude 5y ago
This program is quick & lazy but it uses a 1D python list and pretends it's a 2D list. It implements 2D slicing, giving you a square subset just like ndarray. It doesn't intend to be all correct or nice or useful.
https://www.pythonmorsels.com/p/2rk5t/ https://www.pythonmorsels.com/p/2rk5t/
Is laziness a virtue? I reused the slicing implementation in `range(foo)[index]` so I didn't need to do that logic myself.
- ohyoutravel 5y agoVery nice!