
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10744 Articles

AmitDiwan
182 Views
When it is required to print rows where all its elements’ frequency is greater than K, a method is defined that takes two parameters, and uses ‘all’ operator and iteration to give the result.Below is a demonstration of the same −Exampledef frequency_greater_K(row, K) : return all(row.count(element) > ... Read More

AmitDiwan
98 Views
When it is required to repeat elements at custom indices, a simple iteration, enumerate attribute, the ‘extend’ method and the ‘append’ method are used.Below is a demonstration of the same −Examplemy_list = [34, 56, 77, 23, 31, 29, 62, 99] print("The list is :") print(my_list) index_list = [3, 1, 4, ... Read More

AmitDiwan
2K+ Views
When it is required to find the Fibonacci sequence using the method of recursion, a method named ‘fibonacci_recursion’ is defined, that takes a value as parameter. It is called again and again by reducing the size of the input.Below is a demonstration of the same:Exampledef fibonacci_recursion(my_val): if ... Read More

AmitDiwan
347 Views
When it is required to inverse the dictionary values to a list, a simple iteration and ‘append’ method is used.Below is a demonstration of the same −from collections import defaultdict my_dict = {13: [12, 23], 22: [31], 34: [21], 44: [52, 31]} print("The dictionary is :") print(my_dict) my_result = defaultdict(list) ... Read More

AmitDiwan
357 Views
When it is required to sort a list of strings based on the ‘K’ number of character frequency, the ‘sorted’ method, and the lambda function is used.ExampleBelow is a demonstration of the same −my_list = ['Hi', 'Will', 'Jack', 'Python', 'Bill', 'Mills', 'goodwill'] print("The list is : " ) print(my_list) my_list.sort() ... Read More

AmitDiwan
2K+ Views
To groupby columns and count the occurrences of each combination in Pandas, we use the DataFrame.groupby() with size(). The groupby() method separates the DataFrame into groups.At first, let us import the pandas library with an alias pd −import pandas as pdInitialize the data of lists −# initializing the data mylist ... Read More

AmitDiwan
150 Views
When it is required to extracts elements from a list with digits in increasing order, a simple iteration, a flag value and the ‘str’ method is used.Below is a demonstration of the same −Example Live Demomy_list = [4578, 7327, 113, 3467, 1858] print("The list is :") print(my_list) my_result = ... Read More

AmitDiwan
176 Views
When it is required to perform dual tuple alternate summation, a simple iteration and the modulus operator are used.Below is a demonstration of the same −Example Live Demomy_list = [(24, 11), (45, 66), (53, 52), (77, 51), (31, 10)] print("The list is :") print(my_list) my_result = 0 for index ... Read More

AmitDiwan
215 Views
When it is required to extract rear K digits from numbers, a simple list comprehension, the modulo operator and the ‘**’ operator are used.Below is a demonstration of the same −Example Live Demomy_list = [51645, 24567, 36743, 89452, 2122] print("The list is :") print(my_list) K = 3 print("The value ... Read More

AmitDiwan
205 Views
When it is required to combine list with other list elements, a simple iteration and ‘append’ method is used.Below is a demonstration of the same −Example Live Demomy_list_1 = [12, 14, 25, 36, 15] print("The first list is :") print(my_list_1) my_list_2 = [23, 15, 47, 12, 25] print("The ... Read More