What do you want to save?
Add Code snippet
New code examples
-
Other 2022-03-27 06:20:31
smallest and largest number
# Python program to find largest # number in a list # list of numbers list1 = [10, 20, 4, 45, 99] # sorting the list list1.sort() # printing the last element print("Largest element is:", list1[-1]) Add solution -
-
Python 2022-03-17 02:55:09
Check if a string is lapindrome or not in Python
s=input() s1,s2='','' if(len(s)%2==0): s1=s[:len(s)//2] s2=s[len(s)//2:] else: s1=s[:len(s)//2] s2=s[len(s)//2+1:] l1=list(s1) l2=list(s2) l1.sort() l2.sort() s1=str(l1) s2=str(l2) if(s1==s2): print('YES') else: print('NO') Add solution -
Python 2022-03-13 07:05:06
second max from list python
# Python program to find largest # number in a list # list of numbers list1 = [10, 20, 4, 45, 99] # sorting the list list1.sort() # printing the second last element print("Second largest element is:", list1[-2]) 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
Klaus Aumann
+5
Katka
+5
Luaan
+5
C69
+5
Kittynme73
+5
Meryllee
+5
Meisam
+5
Soe Min Lat
+5
Bolyc
+5
JasonDack
+5