Alias Secondary IP Address

Pranav Bhardwaj
Updated on 07-Sep-2021 11:17:07

1K+ Views

What is Alias/Secondary IP Address?IP aliasing is the process of assigning several IP addresses to a network interface. It allows a single node on a network to have many network connections, each having a different purpose.Multiple network addresses can be provided on a single physical interface using IP aliasing. One rationale for doing so could be to make a single computer appear to be several computers.How to configure?In Linux, to use IP aliasing, the Kernel must be compiled with network aliasing and IP options. Then the aliases would attach to the virtual network device or interface with a specific virtual ... Read More

Remote Direct Memory Access (RDMA)

Pranav Bhardwaj
Updated on 07-Sep-2021 11:15:47

1K+ Views

What is RDMA?The access of one computer's memory by another in a network without the involvement of any computer's operating system, processor, or cache is referred to as RDMA. Because many resources are freed up, it aids in improving system throughput and performance.On a remote machine, read and write operations can be performed without being interrupted by the CPU of that machine. The data transfer rate is increased, and networking latency is reduced, thanks to this technology. It uses zero-copy networking for transferring data directly into system buffers by enabling network adapters.RDMA was earlier used only in high-performance computing (HPC) ... Read More

What is Inter-Switch Link (ISL)?

Pranav Bhardwaj
Updated on 07-Sep-2021 11:12:44

1K+ Views

Inter-Switch LinkISL is a VLAN protocol that stands for Inter-Switch Link. Cisco's ISL is a proprietary protocol that is only utilized between Cisco switches.A point-to-point VLAN context can support up to 1000 VLANs and is only compatible with Fast Ethernet and Gigabit Ethernet networks.ISL encapsulates an Ethernet frame with a header that sends VLAN IDs between switches and routers. The tag in IEEE 802.1Q is internal.An Ethernet encapsulated ISL frame will typically start at 94 bytes and grow to 1548 bytes in size. Encapsulation is used to develop the protocol.The frame is given a 26-byte header and a 4-byte CRC ... Read More

Find Fibonacci Series Using Recursion in Python

AmitDiwan
Updated on 07-Sep-2021 10:59:44

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 my_val

Inverse Dictionary Values in Python

AmitDiwan
Updated on 07-Sep-2021 10:40:32

389 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) for keys, values in my_dict.items(): for val in values: my_result[val].append(keys) print("The result is :") print(dict(my_result))OutputThe dictionary is : {34: [21], 44: [52, 31], 13: [12, 23], 22: [31]} The result is : {52: [44], 31: [44, 22], 12: [13], 21: [34], ... Read More

Sort String List by K Character Frequency in Python

AmitDiwan
Updated on 07-Sep-2021 09:43:22

396 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() print("The list after sorting is ") print(my_list) K = 'l' print("The value of K is ") print(K) my_result = sorted(my_list, key = lambda ele: -ele.count(K)) print("The resultant list is : ") print(my_result)OutputThe list is : ['Hi', 'Will', 'Jack', 'Python', 'Bill', 'Mills', 'goodwill'] The list after sorting is ... Read More

Count Occurrences of Each Combination Using Pandas GroupBy

AmitDiwan
Updated on 07-Sep-2021 09:14:11

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 = {'Car': ['BMW', 'Mercedes', 'Lamborgini', 'Audi', 'Mercedes', 'Porche', 'RollsRoyce', 'BMW'], 'Place': ['Delhi', 'Hyderabad', 'Chandigarh', 'Bangalore', 'Hyderabad', 'Mumbai', 'Mumbai', 'Delhi'], 'Sold': [95, 80, 80, 75, 90, 90, 95, 50 ]}Next, we will create a DataFrame −# DataFrame dataFrame = pd.DataFrame(mylist, columns=['Car', 'Place', 'Sold'])Now, use the groupby() to count the occurrence with ... Read More

Find Common Elements in a Pandas DataFrame

Rishikesh Kumar Rishi
Updated on 07-Sep-2021 08:08:53

6K+ Views

To find the common elements in a Pandas DataFrame, we can use the merge() method with a list of columnsStepsCreate a two-dimensional, size-mutable, potentially heterogeneous tabular data, df1.Print the input DataFrame, df1.Create another two-dimensional tabular data, df2.Print the input DataFrame, df2.Find the common elements using merge() method.Print the common DataFrame.Exampleimport pandas as pd df1 = pd.DataFrame( { "x": [5, 2, 7, 0], "y": [4, 7, 5, 1], "z": [9, 3, 5, 1] } ) df2 = ... Read More

Extract Elements from a List with Digits in Increasing Order

AmitDiwan
Updated on 06-Sep-2021 09:15:38

182 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 = [] for element in my_list:    my_flag = True    for index in range(len(str(element)) - 1):       if str(element)[index + 1]

Python Dual Tuple Alternate Summation

AmitDiwan
Updated on 06-Sep-2021 09:13:39

202 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 in range(len(my_list)):    if index % 2 == 0:       my_result += my_list[index][0]    else:       my_result += my_list[index][1] print("The result is :") print(my_result)OutputThe list is : [(24, 11), (45, 66), (53, 52), (77, 51), (31, 10)] The result is : 225ExplanationA list of ... Read More

Advertisements