Skip to main content
machine yearning's user avatar
machine yearning's user avatar
machine yearning's user avatar
machine yearning
  • Member for 8 years, 5 months
  • Last seen more than 4 years ago
  • Hilo, HI
awarded
awarded
awarded
awarded
comment
Pigeon and grain problem: find time until all the grain is eaten
I turned all the operations over the array into numpy operations, according to my best google-guess. Again feel free to edit if I messed it up.
revised
Loading…
comment
Pigeon and grain problem: find time until all the grain is eaten
@GarethRees What about min(x - T % x for x in xs), does that make sense?
revised
Loading…
Loading…
comment
Pigeon and grain problem: find time until all the grain is eaten
@ChatterOne Not from his description but from the code I realized there's a different x value for each bird.
awarded
awarded
comment
comment
Mean of combined sublists with different lengths
If you use the numpy array data structures I'm pretty sure it automatically flattens the data for you without needing to pass an argument.
comment
Mean of combined sublists with different lengths
How is that complicated? It's literally doing exactly what you specified in your problem statement, nothing more. It's also literally the simplest list comprehension you can write over a nested list.
revised
Loading…
revised
Loading…
revised
Looking for primes with all-different digits
added 744 characters in body
Loading…
comment
Looking for primes with all-different digits
@Daerdemandt. Nice stuff here. Really good point about needless casting. I'll edit my answer just to include a way of grabbing a counterexample
awarded