Sliding window protocol is a transmission control protocol. To hold the outgoing and incoming packets both the sender and receiver maintains a finite buffer. Every packet sent from the sender side must be acknowledged by the receiver.The sender is maintaining a timer for every packet sent, and any unacknowledged packet in a certain time is resent. The sender will send a complete window of packets before receiving an acknowledgement for the first packet in the window. This leads to a higher transfer rate, as the sender may send multiple packets without waiting for each packet's acknowledgement.The Receiver advertises a window ... Read More
Network delay is defined as how much time will take a bit of data to travel from one node to another node.Network delay can be divided into following ways −Transmission delayPropagation delayLet us learn about both of them in detail.Transmission delayIt is the time required to put a packet’s bit (or data bits) on the transmission medium that can be wired or wireless. Transmission delay depends on the length of the packet and bandwidth of the network.Transmission delay can be calculated as follows −Transmission delay = Packet size / bandwidth packet ... Read More
Traffic throttling is one of the approaches for congestion control. In the internet and other computer networks, senders trying to adjust the transmission need to send as much traffic as the network can readily deliver. In this setting the network aim is to operate just before the onset of congestion.There are some approaches to throttling traffic that can be used in both datagram and virtual-circuit networks.Each approach has to solve two problems −FirsRouters have to determine when congestion is approaching ideally before it has arrived. Each router can continuously monitor the resources it is using.There are three possibilities, which are ... Read More
The presence of congestion means the load is greater than the resources available over a network to handle. Generally, we will get an idea to reduce the congestion by trying to increase the resources or decrease the load, but it is not that much of a good idea.There are some approaches for congestion control over a network which are usually applied on different time scales to either prevent congestion or react to it once it has occurred.Admission ControlIt is one of techniques that is widely used in virtual-circuit networks to keep congestion at bay. The idea is do not set ... Read More
Traffic awareness is one of the approaches for congestion control over the network. The basic way to avoid congestion is to build a network that is well matched to the traffic that it carries. If more traffic is directed but a low-bandwidth link is available, congestion occurs.The main goal of traffic aware routing is to identify the best routes by considering the load, set the link weight to be a function of fixed link bandwidth and propagation delay and the variable measured load or average queuing delay.Least-weight paths will then favour paths that are more lightly loaded, remaining all are ... Read More
We will group Pandas DataFrame using the groupby(). Select the column to be used using the grouper function. We will group day-wise and calculate sum of Registration Price with day interval for our example shown below for Car Sale Records.Set the frequency as an interval of days in the groupby() grouper method, that means, if the freq is 7D, that would mean data grouped by interval of 7 days of every month till the last date given in the date column.At first, let’s say the following is our Pandas DataFrame with three columns −import pandas as pd # dataframe ... Read More
To group columns in Pandas dataframe, use the groupby(). At first, let us create Pandas dataframe −dataFrame = pd.DataFrame( { "Car": ["Audi", "Lexus", "Audi", "Mercedes", "Audi", "Lexus", "Mercedes", "Lexus", "Mercedes"], "Reg_Price": [1000, 1400, 1100, 900, 1700, 1800, 1300, 1150, 1350] } )Let us now group according to Car column −res = dataFrame.groupby("Car")After grouping, we will use functions to find the means Registration prices (Reg_Price) of grouped car names −res.mean()This calculates mean of the Registration price according to column Car.ExampleFollowing is the code −import pandas as pd # dataframe with one of ... Read More
To replace values of a DataFrame with the value of another DataFrame, use the replace() method n Pandas.At first, let us first create a DataFrame −dataFrame1 = pd.DataFrame({"Car": ["Audi", "Lamborghini"], "Place": ["US", "UK"], "Units": [200, 500]})Let us create another DataFrame −dataFrame2 = pd.DataFrame({"Car": ["BMW", "Lexus"], "Place": ["India", "Australia"], "Units": [800, 1000]})Next, get a value from DataFrame2 and replace with a value from DataFrame1 −# get value from 2nd DataFrame i = dataFrame2['Car'][1] # replacing with a value from the 1st DataFrame j = dataFrame1['Car'][0]Finally, use the replace() method to replace the value of one DataFrame with value of another ... Read More
We want to replace the negative values with latest preceding positive value. With that, if there’s no positive preceding value, then the value should update to 0.InputFor example, the input is −DataFrame: One two 0 -2 -3 1 4 -7 2 6 5 3 0 -9OutputThe output should be − One two 0 0 0 1 7 0 2 4 2 3 0 2Data Frame masking is used to replace negative values. To fill the missing values, we used forward fill. At first, let ... Read More
To drop specific rows rom multiindex dataframe, use the drop() method. At first, let us create a multi-index array −arr = [np.array(['car', 'car', 'car', 'bike', 'bike', 'bike', 'truck', 'truck', 'truck']), np.array(['valueA', 'valueB', 'valueC', 'valueA', 'valueB', 'valueC', 'valueA', 'valueB', 'valueC'])]Next, create multiindex dataframe and set index also −dataFrame = pd.DataFrame( np.random.randn(9, 3), index=arr, columns=['Col 1', 'Col 2', 'Col 3']) dataFrame.index.names = ['level 0', 'level 1']Now, drop specific row −dataFrame.drop(('car', 'valueA'), axis=0, inplace=True)ExampleFollowing is the code −import numpy as np import pandas as pd # multiindex array arr = [np.array(['car', 'car', 'car', 'bike', 'bike', 'bike', 'truck', 'truck', 'truck']), ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP