
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
2K+ Views
To open a list, we can use append() method. With that, we can also use loc() method. At first, let us import the required library −import pandas as pdFollowing is the data in the form of lists of team rankings −Team = [['India', 1, 100], ['Australia', 2, 85], ['England', 3, ... Read More

AmitDiwan
323 Views
When it is required to get the specific number of power of a number, the ‘**’ operator is used along with list comprehension.ExampleBelow is a demonstration of the samen = 4 print("The value n is : ") print(n) k = 5 print("The value of k is : ") print(k) ... Read More

AmitDiwan
357 Views
When it is required to find duplicate sets in a list of sets, the ‘Counter’ and ‘frozenset’ are used.ExampleBelow is a demonstration of the samefrom collections import Counter my_list = [{4, 8, 6, 1}, {6, 4, 1, 8}, {1, 2, 6, 2}, {1, 4, 2}, {7, 8, 9}] ... Read More

AmitDiwan
298 Views
When it is required to add custom borders to the matrix, a simple list iteration can be used to add the required borders to the matrix.ExampleBelow is a demonstration of the samemy_list = [[2, 5, 5], [2, 7, 5], [4, 5, 1], [1, 6, 6]] print("The list is :") ... Read More

AmitDiwan
910 Views
When it is required to remove words that are common in both the strings, a method is defined that takes two strings. The strings are spit based on spaces and list comprehension is used to filter out the result.ExampleBelow is a demonstration of the samedef common_words_filter(my_string_1, my_string_2): ... Read More

AmitDiwan
9K+ Views
To concatenate DataFrames, use the concat() method, but to ignore duplicates, use the drop_duplicates() method.Import the required library −import pandas as pdCreate DataFrames to be concatenated −# Create DataFrame1 dataFrame1 = pd.DataFrame( { "Car": ['BMW', 'Jaguar', 'Audi', 'Mustang'], "Units": [100, 150, 110, 80] } ) ... Read More

AmitDiwan
385 Views
When it is required to extract elements from a List in a Set, a simple ‘for’ loop and a base condition can be used.ExampleBelow is a demonstration of the samemy_list = [5, 7, 2, 7, 2, 4, 9, 8, 8] print("The list is :") print(my_list) search_set = {6, ... Read More

AmitDiwan
756 Views
When it is required to mask a list with the help of values from another list, list comprehension is used.ExampleBelow is a demonstration of the samemy_list = [5, 6, 1, 9, 11, 0, 4] print("The list is :") print(my_list) search_list = [2, 10, 6, 3, 9] result ... Read More

AmitDiwan
3K+ Views
Median separates the higher half from the lower half of the data. Use the fillna() method and set the median to fill missing columns with median. At first, let us import the required libraries with their respective aliases −import pandas as pd import numpy as npCreate a DataFrame with 2 ... Read More

AmitDiwan
794 Views
The Dataframe.loc is used to access a group of rows and columns by label or a boolean array. We will append a list to a DataFrame using loc. Let us first create a DataFrame. The data is in the form of lists of team rankings for our example −# data ... Read More