
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
118 Views
When it is required to remove rows for a similar ‘K’th column element, a simple iteration, and the ‘append’ method are used.ExampleBelow is a demonstration of the same −my_list = [[45, 95, 26], [70, 35, 74], [87, 65, 23], [70, 35, 74], [67, 85, 12], [45, 65, 0]] print("The ... Read More

AmitDiwan
457 Views
When it is required to count the frequency of a sub-list in a given list, a list comprehension and the ‘len’ method along with the ‘if’ condition are used.ExampleBelow is a demonstration of the same −my_list = [23, 33, 45, 67, 54 , 43, 33, 45, 67, 83, 33, 45, ... Read More

AmitDiwan
189 Views
When it is required to segregate elements based on a delimiter, ExampleBelow is a demonstration of the same −my_list = ["89@21", "58@51", "19@61", "11@10", "32@65", "34@45", "87@90", "32@21", '1@345'] print("The list is : " ) print(my_list) print("The list after sorting is :") my_list.sort() print(my_list) my_delimiter = "@" print("The ... Read More

AmitDiwan
717 Views
When it is required to extract elements that are in between multiple specific range of index, the ‘extend’ method, a simple iteration and indexing are used.ExampleBelow is a demonstration of the same −my_list = [13, 21, 81, 10, 13, 17, 22, 18, 11, 90, 0] print("The list is : ... Read More

AmitDiwan
364 Views
When it is required to sort the elements of a list based on the digits, the ‘max’, ‘max’ method are used. We will also use the ‘sorted’ method, the ‘lambda’ function and ‘ljust’.ExampleBelow is a demonstration of the same −my_list = [4344, 2611, 122, 541, 33, 892, 48292, 460, 390, ... Read More

AmitDiwan
299 Views
When it is required to randomly insert elements K times, the ‘random’ package and methods from the random package along with a simple iteration is used.ExampleBelow is a demonstration of the same −import random my_list = [34, 12, 21, 56, 8, 9, 0, 3, 41, 11, 90] print("The ... Read More

AmitDiwan
572 Views
When it is required to find all the combinations in a list with a specific condition, a simple iteration, the ‘isinstance’ method, the ‘append’ method and indexing are used.ExampleBelow is a demonstration of the same −print("Method definition begins") def merge_the_vals(my_list_1, my_list_2, K): index_1 = 0 ... Read More

AmitDiwan
6K+ Views
To drop multiple levels from a multi-level column index, use the columns.droplevel() repeatedly. We have used the Multiindex.from_tuples() is used to create indexes column-wise.At first, create indexes column-wise −items = pd.MultiIndex.from_tuples([("Col 1", "Col 1", "Col 1"), ("Col 2", "Col 2", "Col 2"), ("Col 3", "Col 3", "Col 3")])Next, create a ... Read More

AmitDiwan
742 Views
When it is required to convert a string into a matrix that has ‘K’ characters per row, a method is defined that takes a string and a value for ‘K’. It uses a simple iteration, the modulus operator and the ‘append’ method.ExampleBelow is a demonstration of the same −print("Method definition ... Read More

AmitDiwan
328 Views
When it is required to convert a list of strings with a delimiter to a list of tuples, a K value is set, and list comprehension along with the ‘split’ method is used.ExampleBelow is a demonstration of the same −my_list = ["33-22", "13-44-81-39", "42-10-42", "36-56-90", "34-77-91"] print("The list is ... Read More