What do you want to save?
Add Code snippet
New code examples
-
-
Python 2022-03-03 07:40:33
python list functions
list.append(x) # append x to end of list list.extend(iterable) # append all elements of iterable to list list.insert(i, x) # insert x at index i list.remove(x) # remove first occurance of x from list list.pop([i]) # pop element at index i (defaults to end... Add solution -
Javascript 2022-03-02 22:25:22
sort array of objects in react js
const books = [ {id: 1, name: 'The Lord of the Rings'}, {id: 2, name: 'A Tale of Two Cities'}, {id: 3, name: 'Don Quixote'}, {id: 4, name: 'The Hobbit'} ] compareObjects(object1, object2, key) { const obj1 = object1[key].toUpperCase() const o... Add solution -
Other 2022-03-02 14:05:01
quicksort
// @see https://www.youtube.com/watch?v=es2T6KY45cA&vl=en // @see https://www.youtube.com/watch?v=aXXWXz5rF64 // @see https://www.cs.usfca.edu/~galles/visualization/ComparisonSort.html function partition(list, start, end) { const pivot = list[end... Add solution -
Python 2022-02-28 13:10:05
argsort in descending order numpy
avgDists.argsort()[::-1][:n] Add solution -
Python 2022-02-23 03:50:08
feature importance naive bayes python
neg_class_prob_sorted = NB_optimal.feature_log_prob_[0, :].argsort()[::-1] pos_class_prob_sorted = NB_optimal.feature_log_prob_[1, :].argsort()[::-1] print(np.take(count_vect.get_feature_names(), neg_class_prob_sorted[:10])) print(np.take(count_vect.get_... Add solution
Best helpers
Ranking is empty