You are on page 1of 2

 Code:  

The code starts by importing pandas as pd.


  Then it reads the data from an Excel file called Data.xlsx and stores it in a dataframe
variable named df.
  The code then creates a list of codes that are prerequisites for each month, which is
stored in another variable named time_list.
  The biendoi function takes an input value x and returns one of 26 different values
depending on what x equals (A-Z).
  For example, if x equals "B", then the function will return 1; if x equals "C", then the
function will return 2; etc., up to 25 if x equals "Z".
  The code compiles a list of the dataframe's values.
  The code will iterate through each row in the list, and return 0 if it is equal to "A", 1 if it
is equal to "B", 2 if it is equal to "C", 3 if it is equal to "D", 4 if it is equal to "E", 5 if it is
equal to "F", 6 if it is equal to "G", 7 if it is equal to "H" etc.
  The code starts by declaring a list of integers, data_list.
  The code then iterates through the list and checks each element for equality with another
element in the list.
  The first function is check_link which takes two integers as input and returns True if
they are equal or False otherwise.
  It uses a nested loop to compare every character in one string with every character in the
other string until it finds a comma (",").
  If there is no comma, it means that both strings have an identical length so it will return
True.
  Otherwise, it will keep comparing characters until it reaches the end of one string and
starts comparing characters from the beginning of the other string again.
  This process continues until either all elements match or there is no more comparison
left to do between them.
  The second function is check_link_reverse which does exactly what its name implies:
reverse order comparisons instead of forward order comparisons like check_link does.
  The code is used to find the maximum and minimum values of a list.
  The code above iterates through each item in the list, checks if it exists in the list, and
increments or decrements its value accordingly.
  The code starts by declaring a list of integers.
  The first integer is the number of days in a month and the second integer is the number
of months in a year.
  Next, it declares two lists: one for saving values and one for counting how many times
each value has been checked.
  The code then iterates through all four possible combinations to check if there are any
links between them.
  If so, they will be saved as 0s with their corresponding sum added to their respective lists
(res[i][0] = 0; res[i][1] = sum(time_list[i]).)
  Otherwise, they will be counted as 1s (res[i][0] = res[save[0]][1]; res
  The code is meant to calculate the sum of a list.
  The code starts by defining the variables that will be used in the calculation.
  The first variable is called save, which contains all of the values from 0-9.
  The second variable is called count, which will keep track of how many times this loop
has been run through and therefore keeps track of how many elements are in the list.
  Next, we create an infinite for loop that iterates through each number in the range (4).
  If check_link(i) evaluates to true then it assigns a value of 0 to res[i][0] and res[i][1].
  Otherwise, if count == 1 then it assigns a value of 0 to res[

First we import panda ( a data analysis library in Python) as pd. Then the code will read the data from
the excel file “Data.xlsx” and stores it in an data frame variable “df”. then creates a list of codes that are
prerequisites for each month, which is stored in another variable named “time_list”. And then we have
“biendoi” function takes an input value X and then return values depending on X (one out of 26 value A
to Z) . the code start to run through all rows, values in the data frame. (example) After that the code
declare a list of integer, “data_list”. Then the code run in the list to check each element for equality with
another element in the list, The first function is check_link which takes two integers as input and
returns True if they are equal or False otherwise. Next is to compare every character in one string with
every character in other string until it finds a comma “,” to finds out that if there is no comma => both
string have an identical length and the code return “True”, Otherwise, it will keep comparing characters
until it reaches the end of one string and starts comparing characters from the beginning of the other
string again. This process continues until all items match or no comparison between items is possible.

Check_link_reverse: so we basically inverse the order of comparisions, next is to find the max and min
value of the list

You might also like