About 7,300,000 results
Open links in new tab
  1. Doing math to a list in python - Stack Overflow

    Oct 7, 2014 · See also: How can I collect the results of a repeated calculation in a list, dictionary etc. (or make a copy of a list with each element modified)? . However, some techniques - especially ones …

  2. Finding the max value of a property in an array of objects

    FWIW my understanding is when you call apply on a function it executes the function with a specified value for this and a series of arguments specified as an array. The trick is that apply turns the array …

  3. Find the min/max element of an array in JavaScript

    APPLY solution: sending the array to the Math.max and/or Math.min internal functions using apply (null,array); REDUCE solution: recursing a check against every element of the array using reduce …

  4. How to randomize (shuffle) a JavaScript array? - Stack Overflow

    /* Randomize array in-place using Durstenfeld shuffle algorithm */ function shuffleArray(array) { for (var i = array.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = array[i]; array[i] = …

  5. How does the Math.max.apply() work? - Stack Overflow

    console.log(Math.max(list)); # NaN will not work, because max doesn't accept an array as input. There is another advantage, of using apply, you can choose your own context. The first parameter, you pass …

  6. Getting a random value from a JavaScript array - Stack Overflow

    Dec 29, 2010 · Consider: var myArray = ['January', 'February', 'March']; How can I select a random value from this array using JavaScript?

  7. How to sum up an array of integers in C# - Stack Overflow

    Great idea. And, for unsigned integer array it would be nice to be able to do ulong sum = arr.Sum (x => (ulong)x); But, sadly, Linq .Sum () doesn't support unsigned integer data types. If unsigned …

  8. How to randomly pick an element from an array - Stack Overflow

    Apr 23, 2015 · I am looking for solution to pick number randomly from an integer array. For example I have an array new int[]{1,2,3}, how can I pick a number randomly?

  9. What is the difference between math.exp and numpy.exp and why do …

    Feb 26, 2023 · math.exp works on a single number, the numpy version works on numpy arrays and is tremendously faster due to the benefits of vectorization. The exp function isn't alone in this - several …

  10. Finding the average of an array using JS - Stack Overflow

    Apr 9, 2015 · I've been looking and haven't found a simple question and answer on stack overflow looking into finding the average of an array. This is the array that I have const grades = [80, 77, 88, …