Advanced Applications of Python Data Structures and Algorith
Advanced Applications of Python Data Structures and Algorith
Technology, Uzbekistan
A. V. Sriharsha
MB University, India
global.com/reference
Product or company names used in this set are for identification purposes
only. Inclusion of the names of the products or companies does not indicate
trademark.
1986-
Includes
this textbook, students will have gained the ability to: Recognize and
(eISBN)
This book is published under the IGI Global book series Advances in
British Library.
The views expressed in this book are those of the authors, but not
ISSN: 2327-3453
Mission
modern organization.
IGI Global is
Coverage
currently accepting
manuscripts for
Virtual Data
Systems
Software
Engineering
Enterprise
Information
Systems
Performance
Modelling
Human-
Computer
Interaction
from any other title within the series. For pricing and ordering information
teaching purposes. The views expressed in this series are those of the
India) Surbhi Vijh (KIET Group of Institutions, India) Vipin Tyagi (Jaypee
Duy Thanh Tran (University of Economics and Law, Ho Chi Minh City,
Vietnam & Vietnam National University, Ho Chi Minh City, Vietnam) and
Technology, India)
and Algorithms
India)
Twin
Industry
Dataflow Paradigms
Kavita Saini (Galgotias University, India) and Pethuru Raj (Reliance Jio
India)
Poland)
Intelligence
Systems
Communication, Italy)
Supercomputing
Systems
University, UK) and Sanjoy Das (Indira Gandhi National Tribal University,
India)
(MNNIT-Allahabad, India)
Applications
Analytics
Metrics and Models for Evaluating the Quality and Effectiveness of ERP
Software
Veracruzana, Mexico)
Technology
Engineering
Development
Data Analytics
Association, USA)
Virtualization
Sustainability
Association, USA)
Software
Association, USA)
Engineering Science Reference • copyright 2018 • 318pp • H/C (ISBN:
Technology, Ukraine)
Reconstruction
Analysis
Porto, Portugal)
Design
Performance Computing
Hungary)
Environments
António Miguel Rosado da Cruz (Instituto Politécnico de Viana do Castelo,
Portugal)
Engineering
Ltd, India)
Organizations
Environments
China)
Computing
USA)
(University of York, UK) Imran Rafiq Quadri (Softeam R&D, France) and
Dynamic Environments
Association, USA)
Information Science Reference • copyright 2014 • 410pp • H/C (ISBN:
Association, USA)
Software Engineering
Emerging Technologies
Process Improvement
Spain)
Enabling the New Era of Cloud Computing Data Security, Transfer, and
Management
USA) Shaofeng Liu (Microsoft, USA) and Qian Wen (Endronic Corp,
USA)
Interdisciplinary Perspectives
System Administration
Irene Maria Portela (Polytechnic Institute of Cávado and Ave, Portugal) and
Oviedo, Spain)
Greece)
Technology, Uzbekistan
A. V. Sriharsha
MB University, India
scientific research and finance to healthcare and beyond. As the demand for
This book delves into the depths of Python's data structures and algorithms,
enhance their skills and beginners aspiring to master the art of data
explores the intricacies of list data structures and their sequential nature,
highlighting their significance in efficient data organization.
dive into linear data structures such as arrays and explores their practical
and Their Uses,” delves into the nuances of stack and queue data structures,
capabilities.
recommendation systems.
Chapter 11, “Optimizing Energy Consumption in Wireless Sensor Networks
imaging, paving the way for automated report generation and improved
healthcare diagnostics.
DNA Sequence,” delves into the use of Python to predict and analyze type 2
diabetes using DNA sequence data, offering insights into the potential of
with the tools to tackle complex data challenges and make informed
decisions.
this enlightening journey through the pages of this book and explore the
starting the book editing, preserve with it, and finally publishing it.
We would not be able to get our work done without the continual support
editors) each other and the authors. This book would not have been possible
Data Structures and Algorithms, an extensive guide that explores the vast
encompassing a diverse range of topics that vividly showcase the power and
the depths of this book, readers will be inspired to unlock novel possibilities
and achieve excellence in their pursuits. Unlock new options and excel in
their endeavours.
CHAPTER 1
A. Keerthana Devi
M. Sujithra
ABSTRACT
structures equips students with the skills to solve real-world problems using
introductory resource for the stack, queue, linked list, graph, trees,
searching, and sorting algorithms. It also offers insights into their Python
INTRODUCTION
A data structure is a meticulously designed framework for organizing,
simple and intricate forms, all devised to arrange data in a manner suited to
specific use cases. Users can conveniently access and employ the required
algorithm and the design of the data structure are closely intertwined. Each
data structure incorporates details about the values and connections of the
data, and in rare cases, it may include functions capable of modifying the
data.
numbers, often prove inadequate for effectively expressing the logical intent
STACK
principle (Carullo, 2020). Under this principle, the item most recently
added to the stack is the first to be removed. The stack can be likened to a
collection of plates, wherein the plate most recently placed on top is the one
necessitates removing all the plates above it. The stack data structure
The following are vital operations associated with a stack data structure:
stack.
● Pop: This operation entails removing an element from the top of the
stack.
empty or not.
● IsFull: This operation verifies whether the stack has reached its
maximum capacity.
● Peek: This operation permits retrieving the value of the top element
the “append()” method is utilized to add elements to the top of the stack,
“pop()” method facilitates the removal of elements from the stack in the
Figure 1.
the execution of operations according to the First In, First Out (FIFO)
principle (Alcoz et al., 2020). Within this definition, a queue is a list where
all additions occur at one end, and all deletions occur at the other. The
operation is initiated on the element first pushed into the Queue. The
purchase, where the individual at the front of the line is the first to receive
service, adhering to the “first come, first served” principle. The front of the
Queue, also known as the head, represents the position of the entry prepared
to be served, while the rear, referred to as the tail, denotes the position of
Characteristics of Queue
The characteristics of a queue data structure encompass the following key
aspects:
● Accessibility: Both ends of the Queue, the front, and the rear, are
• Queue: This is the name assigned to the array that holds the
• Front: This variable indicates the index in the array where the first
• Rear: This variable denotes the index in the array where the last
LINKED LIST
data referred to as elements. The relationship between one link and another
references the following link in the list. The linked list represents the second
• Link: Each link within the linked list can store data elements.
node is connected to the next node. This visual representation of the linked
Each link within the Linked List encompasses a data field or fields, and a
link field is known as “next.” Every link establishes a connection with the
the termination point of the list, the final link is endowed with a null link.
• Doubly Linked List: Unlike a simple linked list, a doubly linked list
connected to the last element as its predecessor, while the last element
• Deletion: The deletion operation removes the first member from the
Insertion Operation
Figure 5.
locate the target node within the linked list for removal. Subsequently, the
necessary adjustments to the list's links are made. The node preceding the
target node, commonly called the “left” node, is redirected to the node
succeeding the target node. This ensures the continuity of the list's
eradicated, eliminating the target node from the list. It becomes inaccessible
pertains to the object stored within the target node. Based on the
undertaken to remove the target node altogether. Lastly, after the deletion
process, the removed node no longer exists within the linked list, and its
Reverse Operation
last node in the list is modified to point back to the head node, effectively
operation, the traversal begins at the head and continues until the list ends.
At this point, the pointer of the last node is adjusted to reference its
preceding node, facilitating the reversal. Verifying that the last node is not
the final node in the original list is imperative. To ensure this, a temporary
node is introduced, resembling the head node and pointing to the last node.
Subsequently, all nodes on the left side of the list are iteratively adjusted to
Except for the first node adjacent to the head node, all subsequent nodes are
reversal process, the head node is updated to point to the new first node,
with the elements appearing in the reverse order compared to their original
linked list.
link.
link.
● LinkedList: A LinkedList comprises a connecting link to the First
and Last links, representing the initial and final links in the list,
respectively.
The doubly linked list representation is given in Figure 8. The following are
● The doubly linked list consists of the first and last link elements.
● Each link encompasses one or more data fields beside the next and
A circular linked list is a variation of a linked list in which the first element
points to the last element, and the last element points back to the first
In the context of a singly linked list, it is noteworthy that the next pointer of
the final node is directed toward the initial node. Figure 9 depicts the Singly
achieved through the assignment of the previous pointer of the initial node
to the last node, and correspondingly, the next pointer of the last node is
directed towards the first node. Figure 10 showcases the Doubly Linked List
The following are the key points to consider based on the given an example:
● In both a singly linked list and a doubly linked list, the “next”
pointer of the last link points to the first link in the list.
● In the case of a doubly linked list, the “previous” pointer of the first
the list.
the list.
selected.
GRAPH
graph data structure (Chen et al., 2020). Let us use an illustration to try to
Story, Video, Link, and Note. Every connection between two nodes is an
edge. If you share a photo, join a group, “like” a page, etc., that relationship
graph data structure utilized for data storage (Souravlas et al., 2021). A
be adjacent.
vertex A to vertex B.
imply the presence of an edge (v, u). Arrows represent edges in such a
Graph Representation
Each row and column within the matrix correspond to a vertex in the
and each element within the linked list associated with that index
an edge.
Graph Operations
Binary Tree
A binary tree is a tree data structure in which each parent node has no more
than two children. A binary tree node comprises three components: data
item, address of the left child, and address of the right child.
A full Binary tree is a binary tree in which each parent node/internal node
Python Implementation
A perfect binary tree is one in which each internal node has exactly two
child nodes, and all leaf nodes are on the same level. An example of perfect
16.
level. Secondly, each leaf component of a complete binary tree must lean
towards the left, signifying that the left subtree of every node is populated
binary tree satisfies the conditions above, it does not invariably qualify as a
full binary tree. The absence of a right sibling for the last leaf element in a
Python Implementation
It is a binary tree in which each node's left and right subtree height
Binary search trees are a data structure designed for efficiently managing
sorted lists of numbers. The term “binary” stems from the fact that each tree
node can have a maximum of two children. This structure enables quick
“search tree.” By leveraging the properties of binary search trees, one can
● The second characteristic states that every node in the right subtree
● The third characteristic of a BST is that each node's two subtrees are
AVL Tree
supplementary data within each node, referred to as the balance factor. This
factor assumes one of three possible values: -1, 0, or +1. The nomenclature
incorporates the capability for each node to accommodate multiple keys and
● All leaves share an equal depth, also known as the height (h) of the
tree.
● The root must have at least two children and contain one key.
B+Tree
Properties:
⌈m/2⌉ - 1 key.
Red-Black Tree
an additional bit within each node to indicate its color, either red or black.
Properties:
black color.
● According to the Root Property, the tree's root node is always black.
● The Leaf Property specifies that all leaf nodes (NIL nodes) in the
● As per the Red Property, if a node is colored red, all its children
● The Depth Property asserts that for any given node, every direct
path from that node to any of its descendant leaves contains an equal
SEARCHING
Linear Search
initiates from one end of the list and progressively examines each element
Binary Search
The process of determining the position of an element within a sorted array
the array for the desired element. The binary search algorithm can be
● Iterative Method
● Recursive Method
Python Implementation
The Python implementation of the Binary Search using the iterative method
SORTING
Sorting is arranging elements in a specific order within a data collection.
Bubble Sort
swaps them iteratively until the desired order is achieved (Inayat, 2021).
Python Implementation
Selection Sort
where the smallest element from an unsorted list is chosen during each
iteration and subsequently inserted at the beginning of the list (Salihu et al.,
2022).
Python Implementation
Figure 25 presents the Python implementation of the Selection sort
algorithm.
Insertion Sort
strategically inserts an unsorted element into its correct position within the
Python Implementation
Figure 26.
Merge sort is a highly utilized sorting algorithm that is founded upon the
Python Implementation
element from the array to divide it into subarrays. During the partitioning
process, the pivot element is positioned such that elements greater than the
pivot are placed on the right side, while elements smaller than the pivot are
placed on the left side. The same partitioning method is applied recursively
to the left and right subarrays until each subarray contains only one
element. At this stage, the individual elements are sorted, and combining
Python Implementation
Counting Sort
Python Implementation
Figure 29.
Radix Sort
Radix Sort is a sorting technique that involves grouping the individual digits
of the same place value before sorting the elements. Subsequently, the
Python Implementation
Figure 30 showcases the Python implementation of the Radix Sort
algorithm.
Bucket Sort
Figure 31.
Heap Sort
Python Implementation
Shell Sort
elements that are initially far apart from each other, gradually decreasing the
Python Implementation
Figure 33.
The chapter introduces the concept of data structures, which are frameworks
with operations like push, pop, isEmpty, isFull, and peek. A queue is a first-
consist of interconnected nodes, and there are different types like singly
linked lists, doubly linked lists, and circular linked lists. The chapter also
briefly mentions the graph data structure, consisting of nodes and edges
REFERENCES
101184. doi:10.1016/j.cola.2022.101184
Arslan, B. (2022). Search and Sort Algorithms for Big Data
Chen, Z., Wang, Y., Zhao, B., Cheng, J., Zhao, X., & Duan, Z.
doi:10.1109/ACCESS.2020.3030076
Dutta, S., Chowdhury, A., Debnath, I., Sarkar, R., Dey, H., &
doi:10.15864/jmscm.1310
8). IEEE.
Apps, 41-54.
Educreation Publishing.
doi:10.1109/ACCESS.2020.2988358
doi:10.1109/CoNTESA57046.2022.10011382
doi:10.1145/1026487.1008112
doi:10.3390/app11167179
Streib, J. T., Soma, T., Streib, J. T., & Soma, T. (2017). Stacks and
1-4842-8191-8_6
Sliding Window with Circular Linked List for Dynamic Data Flow.
doi:10.1145/3424978.3425152
CHAPTER 2
N. Arulkumar
Justin Rajasekaran
R. Vinodini
Pradeepa Ganesan
ABSTRACT
Computer programming aims to organize and process data to get the desired
development based on the data processing capabilities of the language. The list
data type, such as numbers or strings. Occasionally, a list may include data of
mixed types, including numbers and strings. Elements in the list can be
accessed by using the index. Usually, a list's elements are enclosed within
square brackets and divided using commas. The list may be referred to as a
dynamic-sized array, which denotes that its size increases as additional data is
added and that its size is not predefined. List data structure allows repetition;
hence, a single data item may appear several times in a list. The list assists us in
solving several real-world problems. This chapter deals with the list's creation
and manipulation, the complexity of processing the list, sorting, stack, and
queue operations.
Python has a sequence data type called List. It can ably hold multiple elements
of different data types. However, it may have multiple elements of the same data
2021). All the elements in a list must be placed inside the square bracket [], as
shown in Figure 1.
index, as shown in Figure 2. The index must be an integer. The first item is
last item is represented by the index of -1, the second last by -2, and so on.
even after the creation of the List. After creating a list, objects may be added,
removed, shifted, and moved about at will. Python provides several methods for
et al., 2020). Figure 4 illustrates modifying an item or a set of items within a list
altering the content of the List, providing valuable insights into the
The append() method is a popular option for adding a single item to an existing
list. Using the append() function, adding an item to the end of a list is
In situations where multiple items are added to a list, the extend() method is
a list, effectively expanding its size. With the extend() function, it is possible to
Although both methods can add items to a list, their functionality and
application are distinct. The append() method excels at adding a single item to
the end of a list, making the operation straightforward and concise. On the other
hand, the extend() method is more versatile because it permits adding multiple
extend() adds a specified set of items at the end of the existing List, as given in
Figure 6.
Figure 6. Adding a set of items into an existing list using extend() method
Here the list “country_2” items are added to the end of the existing list
not in Returns True if the specified value is not found in the List.
Python's membership operator can be used to find the item in the List, as shown
Time Complexity
how long the List is; hence they are O(1). Append has constant time
complexity, i.e., O(1). Extend has a time complexity of O(k). Here, k is the list
length that needs to be increased. O(n log n) time complexity is required for
STACK
ordered collection of items (data) that are accessed on a LAST IN FIRST OUT
(LIFO) basis (Saabith et al., 2019). The end of the Stack, where items are added
or removed, is considered the TOP of the Stack. The other end of the Stack is
known as the BASE or BOTTOM. The most recently inserted item is always on
top of the Stack and can be removed first. Push and Pop are the terms for adding
The operations PUSH and POP in the Stack are shown in Figure 9 (Hetland,
2017). The top of the plate rack is for adding the new plates. Plates are removed
from the bottom of the plate rack. Table 2 contains the most fundamental
an item on top of the stack. The argument 'n' when utilizing push(n) represents
the item to be added to the list. This operation guarantees that the new item is
placed at the top of the array, where it can be accessed or modified as necessary.
The pop() operation, on the other hand, functions to remove the uppermost
extract or delete a list item. The prior element at the top of the list is removed
when pop() is executed, making the element below it the new element at the
top.
This operation determines whether or not the array contains elements. If the
array is empty, this function returns true to indicate that no items are present. In
contrast, if the stack is not empty, the function returns false, indicating the
necessary to know how many items they comprise. This is where the size()
and determining the overall extent of the data structure. Lastly, the top()
element without modifying the list. This operation retrieves the value of the
item at the top of the stack, allowing developers to investigate or use it without
Time
No Operation Description
Complexity
# Empty List
country=[]
# Add an item on top of the Stack.
def push(x):
country.append(x)
print(“push operation result:”, country)
# Remove an item from the top of the Stack.
def pop():
if (len(country)>0):
x=country.pop()
print(“removed element:”, x)
print(“pop operation result:”, country)
# Check whether or not the Stack is empty.
def empty():
if (len(country)==0):
print(“Stack is empty”)
else:
print(“Stack is NOT empty”)
# Find the number of items in the Stack.
def size():
print(“size() operation result:”, len(country))
# Find the top item in the Stack
def top():
if (len(country)>0):
x=country[-1]
print(“top of the stack is:”, x)
while(1):
print (“Stack Operations”)
print (“****************”)
print (“1. PUSH”)
print (“2. POP”)
print (“3. IS EMPTY”)
print (“4. SIZE”)
print (“5. TOP”)
print (“6. EXIT”)
inp=int(input(“Enter your choice number”))
if(inp > 6 | inp < 1):
print(“Wrong choice so try again “)
else:
if(inp == 1):
name=input(“Enter the country name to
added in the stack:”)
push(name)
if(inp == 2):
pop()
if(inp == 3):
empty()
if(inp == 4):
size()
if(inp == 5):
top()
if (inp == 6):
break
print(“Completed >>>>”)
QUEUE
A queue is a sequential data structure that stores items (data) in an order where
new items are added at one end, generally called the “rear.” The removal of an
existing item occurs at the other end, commonly called the “front.”. A newly
added item to a queue will be at the rear of that queue. The first item added to
the queue will be at the front. This concept is FIFO, which stands for “first in,
first out” (Popescu & Bîră, 2022). ENQUEUE and DEQUEUE are used to add
and delete items from the queue (Kobbaey et al., 2022) (Hunt, 2019).
first person to join the queue will also be the first to depart it. Table 3 lists the
Enqueue(n), dequeue(), isempty(), size(), front(), and rear() are the operations
item to the end of the queue, as indicated by the 'n' operand. It ensures that the
newly added item is placed at the end of the sequence, preserving the order in
The dequeue() operation, on the other hand, removes the first item from the
queue. By eliminating the item from the front of the queue, the FIFO principle
is maintained by promoting the next item to the front. To determine whether the
queue is vacant, we can use the isempty() function. It returns a Boolean value
signifying whether the queue is vacant or contains elements. The size() function
information regarding the queue's size and capacity, allowing us to manage and
returns the element without removing it, which is beneficial when we need a
operation permits access to the final item in the queue. It returns the element
without removing it and provides details about the most recently inserted item.
Time
No Operation Description
Complexity
# Empty List
country=[]
# Add an item on rear of the queue.
def enqueue(x):
country.append(x)
print(“Enqueue operation result:”, country)
# Remove an item from the front of the queue.
def dequeue():
if (len(country)>0):
x=country.pop(0)
print(“removed element:”, x)
print(“Dequeue operation result:”, country)
# Check whether or not the queue is empty.
def empty():
if (len(country)==0):
print(“Queue is empty”)
else:
print(“Queue is NOT empty”)
# Find the number of items in the queue.
def size():
print(“size() operation result:”, len(country))
# Find the top item in the Stack
def front():
if (len(country)>0):
x=country[0]
print(“Front item in the queue is:”, x)
def rear():
if (len(country)>0):
y=country[-1]
print(“Rear item in the queue is:”, y)
while(1):
print (“Queue Operations”)
print (“****************”)
print (“1. ENQUEUE”)
print (“2. DEQUEUE”)
print (“3. IS EMPTY”)
print (“4. SIZE”)
print (“5. FRONT”)
print (“6. RARE”)
print (“7. EXIT”)
inp=int(input(“Enter your choice number”))
if(inp > 7 | inp < 1):
print(“Wrong choice so try again “)
else:
if(inp == 1):
name=input(“Enter the country name to
added in the queue:”)
enqueue(name)
if(inp == 2):
pop()
if(inp == 3):
empty()
if(inp == 4):
size()
if(inp == 5):
front()
if(inp == 6):
rear()
if (inp == 7):
break
print(“Completed >>>>”)
and stretching the limits of data organization with Python lists. Researchers can
delve deeper into these areas to advance list-based data administration and
scenarios in which the size of the List exceeds the quantity of available
Explore and develop advanced list indexing and searching techniques. Consider
instances in which the List contains intricate data structures or nested lists.
memory consumption.
for effectively visualizing large lists. Create interactive frameworks or tools that
enable users to investigate and analyze lists efficiently. Consider using data
Examine methods for ensuring the security and privacy of lists, particularly in
Examine approaches for integrating and interoperating lists with other data
structures for tasks involving machine learning and data extraction. Develop
techniques and algorithms for data analysis and extraction from collections.
techniques for data imputation, outlier detection, and data validation. Examine
CONCLUSION
In this chapter, the organization of data using the list was explored, a sequential
data structure in Python. The basics of lists and their ability to hold multiple
elements of different data types were learned. The access of elements in a list
using indices was discovered, allowing retrieval of specific items based on their
access items from the end of the list. Furthermore, the mutability of lists was
methods for modifying lists were explored, including changing items at specific
were examined for adding items to lists, understanding their differences and use
cases.
The chapter also covered searching and sorting operations on lists. The use of
Python's membership operator to find items in a list and the sorting of a list
using the built-in sort() method were learned. Furthermore, the time complexity
and sorting, was discussed. Next, the stack data structure was introduced as a
such as push and pop were learned. The implementation of a stack using a list
in Python was explored, and code examples for stack operations were provided.
Lastly, the queue data structure, which follows the First-In-First-Out (FIFO)
principle, was discussed. The enqueue and dequeue operations for adding and
removing items from a queue were examined. Similar to the stack, code
Throughout this chapter, various research directions and challenges for further
well as exploring the stack and queue data structures implemented with lists,
readers are equipped with valuable knowledge for effective data organization
invitation for researchers to delve deeper into advanced topics and propose
030-25943-3_34
Kobbaey, T., Xanthidis, D., & Bilquise, G. (2022). Data Structures and
doi:10.1201/9781003139010-6
Navghare, N., Kedar, P., Sangamkar, P., & Mahajan, M. (2020). Python
981-15-1884-3_22
IEEE. doi:10.1109/COMM54429.2022.9817183
doi:10.1007/978-3-030-49720-0
CHAPTER 3
India
ABSTRACT
In a linear data structure, the elements are arranged in a specific order. Each
it as well as the element that follows it. In other words, the elements are
structures and non-linear data structures is given next. Next, all of the
INTRODUCTION
structures play a vital role. They enable us to arrange and manage data
structures can be broadly categorized into Linear Data Structures and Non-
stacks, and queues (Domkin, 2021). Let’s explore these data structures in
Arrays
Furthermore, all elements in an array must belong to the same data type.
Linked Lists
value and a pointer to the next node. Linked lists can be either singly linked
or doubly linked. In a singly linked list, each node has a pointer to the next
node, while in a doubly linked list, nodes have pointers to both the next and
variant of singly linked lists, have the last node pointing back to the first
Stacks
added and removed from the top of the Stack. The push() operation adds an
element to the top, while the pop() function removes the topmost element.
Queues
are added at the back and removed from the front. The primary application
whenever maintaining records in a FIFO order is crucial. They are also used
control, data packet forwarding, and more. Additionally, queues play a role
2013).
Linear data structures offer various ways to manipulate and organize data,
structure depends on specific requirements, such as the need for fast random
following sections, we will delve into a comparison between linear and non-
dissimilarities between linear data structures and other data structures are
requirements of the problem. Factors like the necessity for fast random
access or efficient insertion and deletion operations come into play. Linear
data structures are beneficial for simple problems with direct element
relationships. However, data structures such as trees and graphs may prove
more suitable for more complex situations. The following section will detail
Linear data structures possess distinctive features that make them versatile
queue.
These characteristics bestow linear data structures with the ability to solve
such as trees and graphs might prove more suitable for more complex
algorithms.
queues, find practical use in applications such as web browsers and text
compression techniques.
These examples provide a glimpse into the vast realm of applications for
requirements, such as the need for rapid random access or efficient insertion
section will delve into the advantages of employing linear data structures.
purposes and offer numerous benefits. Here, we delve into the advantages
manipulation.
• Efficiency in Insertion and Deletion: Seamlessly accommodating
alternative data structures such as trees and graphs may be more adept for
discussion.
storage.
between elements. Tasks like finding the shortest path between two
solutions.
ARRAYS
of code required. Each piece within an array possesses a unique index that
facilitates easy access. It’s important to note that Python arrays should not
be confused with lists or numpy arrays, as they are distinct entities. While
Python lists also store values akin to arrays, they possess the flexibility of
uniformity.
The following example demonstrates using Python lists and arrays for
storing values.
Output
becomes evident that a list in Python can store a diverse range of values,
and even other lists. On the other hand, when working with arrays, all
elements need to share the same data type. Fortunately, Python’s array
This functionality allows for the creation of arrays with integers ranging
from one to eight bytes in size, floating-point values with sizes of four and
eight bytes, and arrays containing Unicode characters with a size of two
bytes. When using the array() function, the first parameter represents a code
that specifies the desired type. To illustrate the practical usage of arrays in
Output
When to mix the values belonging to different data types, Python doesn’t
Output
memory wastage encountered with arrays. The advantage lies in the fact
that linked lists eliminate the need for pre-allocated memory and allow non-
contiguous locations for data storage. In a linked list, nodes store elements
and are interconnected, with each node linked to the next one. Specifically,
a singly linked list comprises nodes with a data field and a pointer called
“next,” which points to the subsequent node. The last node in the List points
to a null value, indicating the end. The initial node, the head node (refer to
Figure 4), marks the beginning of the linked List (Baka, 2017).
starting at the head node and then scanning each subsequent node through
the next pointer until a null value is encountered. When creating a new list,
two classes are required: “node” and “linked_list.” The “node” class
members: “info” and “next.” “info” stores the data value of the node, while
“next” holds the reference to the next node in the List. In Python, the
“None” to the “next” member. The data for a node is passed as a parameter
demonstrates the usage of the “create_list()” function for list creation and
the “traverse_list()” function for list traversal. The Python code for creating
class node:
def __init__(self, info):
self.info=info
self.next=None
class linked_list:
def __init__(self):
self.head=None
def create_list(self, info):
if self.head is None:
self.head=node(info)
self.head.next=None
else:
p=node(info)
q=self.head
while q.next is not None:
q=q.next
q.next=p
p.next=None
def traverse_list(self):
p=self.head
while p is not None:
print(p.info, end=' ')
p=p.next
mylist=linked_list()
n=int(input('How many elements you want to enter
in the list? '))
for i in range(n):
info=int(input('Enter value: '))
mylist.create_list(info)
print('The Elements in the Linked List are....',
end=' ')
mylist.traverse_list()
Output
create_list() Method
named “info,” housing the cherished value of a data element. Its initial
bestowed with the virtue of having its next pointer set to None. Conversely,
tracing the path from the head node until the very last node. Herein lies the
to the List, as the previous node's next pointer seamlessly interlocks with
the newly minted node. Alas, to maintain the structure, the following field
of the new node graciously assumes the value of None, signifying the end
of this union.
traverse_list() Method
the traverse_list() method displays all the nodes in the List, starting from the
head and following the subsequent nodes' next field until the List ends.
Insertion
Deleting a Node
information field and two pointers - next and previous. This fundamental
difference from a singly linked list enables seamless traversal in both the
linked list provides increased flexibility. Using the diagram below, let’s
represent a node within the List. The “node” class consists of three
members: “info”, “next”, and “previous”. The “info” field stores the data
value of the node, while the “next” and “previous” pointers are used to
contains a ” head ” field,” which refers to the first node in the doubly-linked
“traverse_list().” These methods are responsible for creating a new list and
insertion and deletion methods. When adding a node to the List, we must
ensure that the “next” and “previous” pointers are set correctly. If the List is
empty, the new node becomes the head, so we assign the “head” field to the
new node, and both the “previous” and “next” fields are set to None.
However, if the List is not empty, adding a node involves traversing to the
end of the List and making the last node point to the new node. This is
achieved by assigning the “next” pointer of the last node to the new node,
while the “previous” field of the new node should point to the node at the
end of the existing List. The Python code for the Doubly Linked List is
given below.
class node:
def __init__(self, info):
self.info=info
self.next=None
self.previous=None
class doubly_linked_list:
def __init__(self):
self.head=None
def create_list(self, info):
p=node(info)
if self.head is None:
self.head=p
self.head.next=None
self.head.previous=None
else:
q=self.head
while q.next is not None:
q=q.next
p.previous=q
p.next=None
q.next=p
def traverse_list(self):
p=self.head
while p is not None:
print(p.info, end=' ')
p=p.next
mylist=doubly_linked_list()
n=int(input('How many elements you want to enter
in the list? '))
for i in range(n):
info=int(input('Enter value: '))
mylist.create_list(info)
print('\nThe Elements in the Linked List are
(Traversing Forward)....', end=' ')
mylist.traverse_list()
Output
However, the last node points to the head node (Guzdial & Ericson, 2012).
The Python code for the Circular linked list is given below.
class node:
def __init__(self, info):
self.info=info
self.next=None
class circular_linked_list:
def __init__(self):
self.head=None
self.last=None
def append(self, info):
p=node(info)
if self.head is None:
self.head=p
self.last=p
self.last.next=self.head
else:
self.last.next=p
self.last=p
self.last.next=self.head
def display_circular(self):
p=self.head
print(p.info, end=' ')
while p.next is not self.head:
p=p.next
print(p.info, end=' ')
print('\nThe Next Element in the
Circular Linked List...', end=' ')
print(p.next.info, end=' ')
circularlist=circular_linked_list()
n=int(input('How many elements you want to enter
in the list? '))
for i in range(n):
info=int(input('Enter value: '))
circularlist.append(info)
print('\nThe Elements in the Circular Linked List
are....', end=' ')
circularlist.display_circular()
STACK
The Stack stands out as it adheres to a Last In First Out (LIFO) order. This
implies that elements are added and removed from the last position. Adding
an element is known as the push() operation, while the removal is called the
retrieves the topmost element from the Stack without deleting it. Presented
class node:
def __init__(self, info):
self.info=info
self.next=None
class Stack:
def __init__(self):
self.head=None
self.top=None
def push(self, info):
p=node(info)
if self.isEmpty():
self.head=p
self.top=p
self.head.next=None
self.top.next=None
else:
self.top.next=p
p.next=None
self.top=p
def pop(self):
if self.isEmpty():
print(“\nStack is
Empty!!!\nStack Underflow!!!\n”);
return -9999
else:
n=self.top.info
if self.top==self.head:
self.top=None
self.head=None
else:
p=self.head
while p.next is
not self.top:
p=p.next
p.next=None
self.top=p
return n
def peek(self):
if self.isEmpty():
print(“\nStack is
Empty!!!\nStack Underflow!!!\n”);
return -9999
else:
n=self.top.info
return n
def stack_traversal(self):
if not self.isEmpty():
p=self.head
while p is not None:
print(p.info,
end=' ')
p=p.next
else:
print(“\nStack is
Empty!!!\n”);
def isEmpty(self):
if self.top is not None:
return False
else:
return
True
mystack=Stack()
n=int(input('How many elements you want to enter
in the stack? '))
for i in range(n):
info=int(input('Enter value: '))
mystack.push(info)
print('\nStack Traversal\n')
mystack.stack_traversal()
print('\nElement at the top of stack: ')
print(mystack.peek())
print('\nAdding an element: ')
info=int(input('Enter value: '))
mystack.push(info)
print('\nElement at the top of stack: ')
print(mystack.peek())
print('\nRetrieving the elements of Stack...',
end=' ')
while not mystack.isEmpty():
x=mystack.pop()
print(x, end=' ')
print('\nStack Traversal\n')
mystack.stack_traversal()
Output
means elements are added to the queue from the last position and removed
from the front. The two ends of a queue are the front and rear. Elements are
removed from the front end and inserted at the rear end of the queue. The
queue contains any elements. It returns a valid Boolean value when the
queue is empty. Similarly, the isFull() operation indicates whether the queue
has reached its maximum capacity and produces an excellent Boolean value
in such cases. However, if the queue is implemented using a linked list, the
class node:
def __init__(self, info):
self.info=info
self.next=None
class Queue:
def __init__(self):
self.front=None
self.rear=None
def enqueue(self, info):
my_node=node(info)
if self.front is None:
self.front=my_node
self.rear=my_node
self.front.next=None
self.rear.next=None
else:
if self.front==self.rear:
self.rear.next=my_node
self.rear=self.rear.next
self.rear.next=None
self.front.next=self.rear
else:
this_node=self.rear
self.rear.next=my_node
self.rear=my_node
self.rear.next=None
def dequeue(self):
if self.front is None and
self.rear is None:
print('\nQueue is
Empty!!!\n');
else:
if self.front==self.rear:
self.front=None
self.rear=None
else:
this_node=self.front
self.front=this_node.next
this_node=None
def isEmpty(self):
if self.front is None and
self.rear is None:
return True
else:
return False
def traverse_queue(self):
if self.front is None and
self.rear is None:
print('\nQueue is
Empty!!!\n');
else:
this_node=self.front
while this_node is not
None:
Output
Each node is assigned a priority in a priority queue, and the nodes are
organized based on their priority. The node with the highest priority is
placed at the front, while the node with the lowest priority is at the rear.
when performing the Dequeue operation. Priority queues find practical use
in various real-life scenarios (Üçoluk et al., 2012). For instance, in CPU job
jobs are executed before lower-priority jobs. It is important to note that the
priority than the new node and inserts the new node before it. In this
context, priority is represented as an integer ranging from 1 to 10, where 1
CONCLUSION
structures and their applications, with a specific focus on arrays, linked lists,
stacks, and queues. These data structures offer efficient ways to organize
processing.
The drawbacks of linear data structures have also been discussed, such as
limited access to elements, slow random access, fixed size, memory usage,
essential, especially when dealing with complex scenarios that may require
alternative data structures like trees and graphs. Overall, the research has
and process data in various domains, ranging from storage systems and
knowledge gained from this research work can serve as a solid foundation
REFERENCES
Publishing Ltd.
Lisp, 75-99.
Structures for Massive Data Sets. In SODA (Vol. 10, pp. 909-910).
doi:10.1090/dimacs/050/02
doi:10.1109/MCSE.2011.36
Zhang, H. L., Han, B. T., Xu, J. C., & Feng, Y. (2013). Preparation
doi:10.1007/978-3-642-40063-6_100
CHAPTER 4
https://orcid.org/0000-0002-7893-9072
https://orcid.org/0000-0002-0068-5519
ABSTRACT
that can be performed on both data structures, such as push, pop, enqueue,
code snippets demonstrating Stack and Queue data structures further to aid
and practitioners.
INTRODUCTION TO STACK
A stack is a simple linear abstract data structure with finite (predefined)
capacity that follows the Last In First Out (LIFO) principle. That means the
element inserted last into the Stack will be removed first. Conversely, it can
say that First In Last Out (FILO). That means the element inserted first into
the Stack will be removed last. Both insert and delete operations are
performed only on the Top of the Stack. TOP is a marker pointing to the
current position in the Stack (Goodrich et al., 2013; Vasudevan et al., 2021).
The initial value of Top is -1. Figure 1 provides examples of stack data
structure.
FEATURES OF STACK
3. The push() method inserts new items into the Stack, while the drop()
function removes components from the Stack. Only at one end of the
Stack, termed the Top, are insert and delete operations done.
4. When a stack is filled, and no additional components can be added,
STACK OPERATIONS
Basic
Description
Operations
Additional
Description
Operations
PUSH Operation-Algorithm
1. First, check whether the Stack is full or has space to insert more
elements.
2. Print the message “Stack Full” and exit if the Stack is full.
3. Increase the top value and add the new element if the Stack is
incomplete.
POP Operation-Algorithm
1. The pop operation will check whether the Stack has data or is empty.
3. Returns the element at the Top of the Stack and decreases the Top of
STACK IMPLEMENTATION
Two different methods are used to implement the stack operations. A Stack
Element H @ M # C T % P D $
Index 0 1 2 3 4 5 6 7 8 9
1. Start
2. Push(“^”)
3. y=4
6. y=y-1
7. Push(“&”)
8. End
APPLICATIONS OF STACK
frame onto the Stack with the following information whenever the
process is called:
▪ After the function has finished executing, its frame will be taken
off the Stack, and the method at the Top of the Stack will assume
control.
sites in Web browsers. Every time a user visits a new website, the
recent changes and restore the document to its former state. This
batch.
6. Recursion: Recursion is another use case of stack solutions often
when there are steps along a path (state) from a starting point to a goal.
and it is possible to discover that the chosen path leads to a dead-end. The
objective is to return to the decision point and pursue the next alternative.
notation.
Stack
Symbol/Token Operation Calculation
Content
3 PUSH(3) 3
6 PUSH(6) 3 6
4 PUSH(4) 3 6 4
A = POP() B =
A = 4
POP()
* 3 24 B = 6
C = B * A
C = 6 * 4 = 24
PUSH(C)
+ A = POP() B = 27 A = 24
POP() B = 3
C = B + A C = 3 + 24 =
PUSH(C) 27
5 PUSH(5) 27 5
A = POP() B =
A = 5
POP()
- 22 B = 27
C = B - A
C = 27 - 5 = 22
PUSH(C)
) POP() Result = 22
5.
postfix expression.
P / (R + S) – N * M
(
P ( P
/ (/ P
( (/ ( P
R (/ ( P R
+ (/ (+ P R
S (/ (+ P R S
) (/ P R S +
- (- P R S + /
N (- P R S + / N
* (- * P R S + / N
M (- * P R S + / N M
) P R S + / N M * -
The Stack data structure helps solve various computer science problems,
software developer. The following is the Python code for stack operations in
Figures 6 and 7.
(predefined) capacity that follows the First In First Out (FIFO) principle.
This means the first element inserted into the Queue will be removed first.
In reverse, it can be written as Last In Last Out (LILO). That means the last
element inserted into the Queue will be removed last. Front and Rear are the
two markers used to perform the queue operations. All the insertions will be
done at the Rear, and the deletions at the Front. The initial value of both
Front and Rear are -1, and both the values are reset to 0 when the first data
item is inserted into the Queue. Only the rear value will be increased for the
subsequent insertion, and only the rear value will be raised for the deletions
(Thomas, 2021). The examples of Queue data structure are given in Figure
8.
FEATURES OF QUEUE
delete an element from the queue dequeue() function is used. All the
insertions will be done at the Rear, and the deletions will be done at
the Front.
4. The Front refers to the first element of the Queue, and the Rear
5. The overflow condition occurs when the Queue is complete, and the
QUEUE OPERATIONS
Additional
Description
Operations
Enqueue Operation
2. Print the message “Queue is full” and exit if the Queue is complete.
3. If the Queue is incomplete, set the Front and rear values to 0 when
inserting the first item into the Queue. Only increase the rear value
The Queue operations are given in Figure 9. The following is the algorithm
for Dequeue.
3. If the Queue is not empty, return the front element and increment its
front value by 1.
2015).
Enqueue(8) - [8]
Enqueue(3) - [8, 3]
Enqueue(5) - [8, 3, 5]
Enqueue(2) - [8, 3, 5, 2]
Empty() False
Len() 4 [8, 3, 5, 2]
Dequeue() 8 [3, 5, 2]
Dequeue() 3 [5, 2]
Enqueue(7) - [5, 2, 7]
Dequeue() 5 [5, 2, 7]
Len() 2 [2, 7]
Empty() False
Front() 2 [2, 7]
Rear() 7 [2, 7]
Dequeue() 2 [7]
Dequeue() 7 [ ]
Dequeue() Error [ ]
Empty() True [ ]
Len() 0 [ ]
QUEUE IMPLEMENTATION
Figure 11.
TYPES OF QUEUES
Queues are classified into four different types, which are mentioned below.
• Circular Queue
• Priority Queue
Simple/Linear Queue
• FRONT and REAR will be the same when a single element exists.
• A queue will be full when the REAR reaches the last index of the
array.
Circular Queue
Queue will generate an error message “Queue is full.” However, the Queue
has empty spots and cannot be used to save the element. To resolve this
• The last node of the Queue will be connected to the first node of the
• Circular Queue accesses its data in the principle of First In First Out.
• FRONT and REAR will be the same when a single element exists.
FRONT = REAR+1.
The Circular Queue is specified in Figure 14, and the circular queue
Sample Operations
data structure in which the first and last elements are connected to form a
circle. These operations are essential for implementing and working with a
access the Front and Rear elements of the Queue (Aggarwal, 2021).
items. It has two ends, Front and Rear, so the item stays in the collection,
with Dequeue).
• FRONT and REAR will be the same when there exists a single
element.
REAR)
structure, with the addition of a “priority” value for each constituent of the
their priority.
accessed in the order they were inserted into the priority queue.
The Python code featured in Figure 19 and 20 is used for Queue operations.
below.
3. A call center phone system that uses queues to wait for a service
using queues.
A few differences between Stack and Queue are discussed below for better
and Rear].
The Top is the only marker that The Rear helps to insert data
CONCLUSION
expression evaluation, and finding the shortest path in a graph. The chapter
has included clear and concise Python code snippets to make it easier for
This chapter has been an excellent resource for computer science students,
choose the most appropriate structure for their needs. Overall, this chapter
Publishing Ltd.
3-031-01326-3_6
Dhruv, A. J., Patel, R., & Doshi, N. (2021). Python: the most
Harris, C. R., Millman, K. J., Van Der Walt, S. J., Gommers, R.,
Virtanen, P., Cournapeau, D., Wieser, E., Taylor, J., Berg, S.,
Smith, N. J., Kern, R., Picus, M., Hoyer, S., van Kerkwijk, M. H.,
Brett, M., Haldane, A., del Río, J. F., Wiebe, M., Peterson, P., &
Cengage Learning.
Arman Abouali
https://orcid.org/0000-0003-1666-2001
A. V. Sriharsha
ABSTRACT
Algorithms are at the heart of computer programming. They form the basis
that involve making decisions over time. This chapter discusses dynamic
reference.
INTRODUCTION
Algorithms are at the heart of computer programming. They form the basis
problems, greedy algorithms shall be used to find the best outcome given a
require exploring multiple solutions before finding the best one. The divide
& conquer technique breaks a problem into smaller parts so that each part
can be solved separately before being combined for a final solution. Finally,
DYNAMIC PROGRAMMING
their solutions in a table for later use. This technique helps reduce the time
complexity of these problems and makes them easier to solve (Kool et al.,
and computing time. Consequently, the processor may need help allocating
them down into smaller, more manageable sub-problems and archiving the
solutions for use when the smaller sub-problems come up later. The
recursion.
broken down into smaller sub-problems that can be solved recursively. The
problem (Taylor, 2019). For instance, the goal of a scheduling task can be to
Minimizing the overall cost of retaining inventory over time may be the
decisions at each step in the sequence and using these decisions to build up
a solution to the overall problem. Another technique for optimization in
make more informed decisions that result in improved profits and outcomes.
This technique is beneficial when there are multiple possible solutions with
various issues, from optimization and planning to game theory and machine
methods.
2012):
• Define the Problem and Identify the Subproblems: Dynamic
into smaller subproblems. Define the problem you want to solve and
identify the subproblems that will help you reach the solution.
programming.
go.
computed the solutions to all of the subproblems, you can use them to
Its subproblem should possess the following key attributes to solve any
process.
breaking the problem down into smaller subproblems and storing the
polynomial.
for recomputing the key multiple times, thus saving time and memory
space. This makes it ideal for many real-world applications, such as solving
and scheduling tasks, etc. When the function is called with a particular
problem instance, it first checks whether the solution for that instance is
that instance while storing the result in the memoization table for future use
general steps:
subproblems.
3. Define the Base Cases: Define the base cases for the subproblems.
The base cases are the simplest subproblems that can be solved directly
should check the memoization table first to see if the solution to the
subproblem has already been computed. If it has not, then the function
the initial parameters and populate the memoization table with the
6. Return the Final Solution: Once the memoization table has been
Overall, the top-down approach involves breaking down the problem into
solving the subproblems and then combine their solutions to find the
subproblems.
3. Define the Base Cases: Define the base cases for the subproblems.
The base cases are the simplest subproblems that can be solved directly
5. Return the Final Solution: Once the memoization table has been
fully populated, return the solution to the original problem, which will
Overall, the bottom-up approach involves breaking down the problem into
management.
Board Problem, and Dijkstra's Algorithm (Li et al., 2020; Senaras et al.,
FIBONACCI SERIES
science. It can solve many problems, such as computing the nth Fibonacci
Fibonacci series. Let us consider generating the “nth” term of the Fibonacci
th
series as a complex problem to be solved. The N term of the Fibonacci
th th
series is equal to the sum of (N-1) Fibonacci term and (N-2) Fibonacci
term. The Fibonacci series problem and the inherent recurrence of the
the first two levels of problem division into smaller tasks or subproblems, it
repeated.
subproblems
The Fibonacci series problem inherently comprehends two features – its
subproblems repeatedly occur over time. Let us understand with the help of
is expressed as the sum of F(4) and F(3). (F(4) and F(3) are
subproblems)
is expressed as the sum of F(3) and F(2). Here the subproblem F(3) is
is expressed as the sum of F(2) and F(1). Here the subproblem F(2) is
and so on.
This process of calculating the subproblems multiple times to obtain the
One way to solve the problem of generating the first N Fibonacci terms is to
reduce the time complexity of a given problem. This section will explore
technique. Still, the answers to any of the subproblems are preserved when
the subproblems are encountered and solved for the first time. The held
once. This provides savings in the computational time for solving the
problem (Forootani et al., 2021; Xu & Wu, 2021; Xie et al., 2021).
The following is the Python code for generating the first N Fibonacci terms
programming.
Input: How many Fibonacci terms are to be generated? (Enter any number
> 2): 5
Output: 0 1 1 2 3
are reordered for solving. Only two intermediate results are to be stored at a
time, which will allow computing the solution to each subproblem only
once. For instance, all that is required are the answers to F(1) and F(0)
when trying to generate F(2). Similarly, generating F(2) and F(3) requires
that we have the answers to F(2) and F(1). As a result, the solution will
consume less memory. The following is the Python code for generating the
Input: How many Fibonacci terms are to be generated? (Enter any number
> 2): 8
Output: 0 1 1 2 3 5 8 13
For the top-down approach, each subproblem is solved only once. Since
O(N). In the bottom-up approach, each subproblem is solved only once. So,
the time complexity of the algorithm is O(N). However, only the most
recent two Fibonacci terms are only to be maintained; the space complexity
three towers and n disks (each of the disks of a different size), the objective
is to move the entire stack of disks from one tower to another tower with the
following restrictions:
• Each move consists of taking the upper disk from one of the stacks
source, target, aux) that takes four arguments can be defined where:
moved from the source tower to the target tower. For n > 1, memoization
Hanoi (n, source, target, aux) shall be stored in a table, indexed by the
values of n, source, target, aux. If a call to Hanoi (n, source, target, aux)
returned. The recursive algorithm for Hanoi (n, source, target, aux) is as
follows:
4. Recursively move n-1 disks from aux to target, using the source as
Input:
Output:
This function takes four arguments: the number of disks to be moved (n),
source tower (source), auxiliary tower (aux), and target tower (target). It
also takes an optional memo dictionary, which stores the results of previous
function calls. The function first checks whether the result of this particular
call to Hanoi is already in the memo dictionary. If it is, it returns the stored
the top disk from the source tower to the target tower and stores this move
itself to move n-1 disks from the source tower to the auxiliary tower, using
the target tower as the auxiliary tower. It then stores the result of this
recursive call in the memo dictionary. It then moves the largest disk from
the source tower to the target tower and adds this move to the result list.
Finally, it recursively calls itself to move n-1 disks from the auxiliary tower
to the target tower, using the source tower as the auxiliary tower.
DIJKSTRA'S ALGORITHM
only once. Dijkstra's algorithm is a popular approach for finding the shortest
path from a source node to all other nodes in a weighted graph. The basic
idea behind Dijkstra's algorithm is to start at the source node and repeatedly
visit the unvisited neighbor with the smallest tentative distance until all
queue to maintain the vertices that have not yet been processed.
1. Initialize the distance to the source node as 0 and the distance to all
nodes.
3. Insert the source node into the priority queue with a priority of 0.
a. Extract the node with the smallest tentative distance from the
priority queue.
following:
the weight of the edge between the two nodes to the distance
distance array and insert the neighbor into the priority queue
5. After all, nodes have been processed; the distance array will contain
the shortest distance from the source node to all other nodes.
shortest distance between a start node to all the other nodes in the weighted
import heapq as hp
# Dijkstra() function returns a list of shortest
distances from the
# start node to all the other nodes in the graph
def dijkstra(graph, start):
# Initialize distances to all nodes
distances = {node: float('inf') for node in
graph}
distances[start] = 0
# Create a heap to store nodes that need to be
processed
heap = [(0, start)]
# Iterate until all nodes have been processed
while heap:
# Get the node with the smallest distance
from the heap
(curr_dist, curr_node) = hp.heappop(heap)
# If the current distance is > than the
previously
# calculated distance, skip it
if curr_dist > distances[curr_node]:
continue
# Update the distances of all the
neighbors of current node
for neighbor, weight in
graph[curr_node].items():
distance = curr_dist + weight
# Update the distance of current node
if required
if distance < distances[neighbor]:
distances[neighbor] = distance
# Add the neighbor to the heap to
be processed
hp.heappush(heap, (distance,
neighbor))
# Return the list of shortest distances
return distances
# Sample graph
graph = {
1: {2: 2, 3:4, 4:2},
2: {3: 3, 4:1},
3: {1: 4},
4: {3:1}
}
# Sample function call to find shortest routes
from node 1 to all
# other nodes
d = dijkstra(graph, 1)
print(d)
Output:
{1: 0, 2: 2, 3: 3, 4: 2}
lists, where graph[i] is a list of pairs {j: w} representing the edges going out
from node i, where j is the index of the neighbor node and w is the weight
of the edge. 'start' is the starting node for the algorithm. The algorithm uses
a heap to store the graph nodes that need processing. The heap is
maintained with the nodes with the smallest distance from the start node at
the top. The algorithm iterates until all nodes have been processed, updating
the distances to each neighbor of the current node if the new distance is
shorter than the current distance (Gouse et al., 2019; Reshma et al., 2022).
these tiles such that no two adjacent tiles have the same
color?
The Checkered board problem can be solved using the top-down dynamic
calculates the number of ways to fill the checkered board of size “i x j” with
the given color of the top-left cell. The color parameter can be either “B” or
3. If the board size is 2 x 1, return 2 if the top-left cell has the same
1. If the top-left cell has the same color as the second cell, we can only
fill the rest of the board with alternating colors. So, we need to
calculate the number of ways to fill the remaining board with the
2. If the top-left cell has a different color than the second cell, we can
either fill the second cell with the same color as the top-left cell or
with the opposite color. So, we need to calculate the number of ways to
fill the remaining board in both cases and add them up. This can be
top-left cell and oppositeColor is the opposite color of the top-left cell.
memo = {}
def countWays(rows, cols, color):
if (rows, cols, color) in memo:
return memo[(rows, cols, color)]
if rows == 1 and cols == 1:
return 1
elif rows == 1 and cols == 2:
return 2 if color == “B” else 1
elif rows == 2 and cols == 1:
return 2 if color == “B” else 1
sameColor = color
oppositeColor = “B” if color == “W” else “W”
if color == “B”:
oppositeColor = “W”
else:
oppositeColor = “B”
if color == “B”:
if (rows-2, cols, oppositeColor) not in
memo:
memo[(rows-2, cols, oppositeColor)] =
countWays(rows-2, cols,
oppositeColor)
return memo[(rows-2, cols, oppositeColor)]
else:
if (rows-2, cols, sameColor) not in memo:
memo[(rows-2,cols,sameColor)]=
countWays(rows-
2,cols,sameColor)
print(countWays(2,1,”B”))
Output:
used to solve problems are all emphasized in this chapter. Additionally, the
CONCLUSION
Dynamic programming is an algorithmic approach that enables us to solve
each optimally. It can identify which parts of the problem can be reused
from previous attempts at solving it, thus saving time and resources. In this
REFERENCES
University Press.
Scientific.
Forootani, A., Tipaldi, M., Ghaniee Zarch, M., Liuzza, D., &
doi:10.1080/00207179.2019.1661521
Gouse, G. M., & Ahmed, A. N. (2019). Ensuring the public cloud
doi:10.47577/technium.v3i8.4554
Media.
Kool, W., van Hoof, H., Gromicho, J., & Welling, M. (2022, June).
2022, Los Angeles, CA, USA, June 20-23, 2022, Proceedings (pp.
doi:10.1007/978-3-031-08011-1_14
Li, G., Rana, M. N., Sun, J., Song, Y., & Qu, J. (2020). Real-time
doi:10.1007/s11042-020-09586-y
Liu, D., Xue, S., Zhao, B., Luo, B., & Wei, Q. (2020). Adaptive
doi:10.3390/a16030139
Samanta, D., Dutta, S., Gouse, M., & Pramanik, S. (2021). A Novel
Computing. doi:10.1007/978-981-16-4284-5_37
Tarek, A., Elsayed, H., Rashad, M., & Hassan, M. (2020, October).
doi:10.1201/9780429040917
243. doi:10.1016/j.apm.2021.03.048
G. B. Anuvarshini
M. Sujithra
ABSTRACT
Python provides extensive library support for data science and analytics,
which has functions, tools, and methods to manage and analyze data.
Python Libraries are used for exploratory data analysis. Libraries in Python
such as Numpy, Pandas, Matplotlib, SciPy, etc. are used for the same. Data
and outliers in big data sets. One of the processes in the data science
process is data visualization, which asserts that after data has been gathered,
result, it is crucial to have systems in place for managing and regulating the
quality of corporate data, metadata, and data sources. So, this chapter
focuses on the libraries used in Python, their properties, functions, how few
data structures are related to them, and a detailed explanation about their
INTRODUCTION
The vital process of performing primary analyses on data to explore new
analysis. Some concepts utilized may succeed while others may fail,
Numpy
Pandas
(Khandare et al., 2023). It eliminates the need for separate NumPy imports
Matplotlib
is widely used to create charts, such as bar graphs, histograms, and scatter
Sci-Kit
tabular datasets, utilizing x and y variables for supervised learning and only
quantitative manners.
Seaborn
Statistical analysis involves understanding relationships and their
enable the human eye to detect patterns. Seaborn, a Python library built on
These functions run only if the panda's library is imported to the Python
Data.info()
This Python code helps obtain the attributes of our dataset or data frame (if
in CSV format), their total non-null elements, and their data types for each
attribute, field, or column name. Also, this .info() function in Python helps
identify the number of instances or rows present in our data for further
analysis.
data.describe()
This function in Python describes the data, which returns the descriptive
statistics values of our data frame such as count, minimum, and maximum
values out of all the elements under each attribute, mean, standard
Duplicate Values
data.duplicated().sum()
values. When the values are duplicated, those can negatively impact our
human error or misinterpretation. It is good when all the values are unique
in the data and there are null duplicate values. (However, sometimes,
duplicate values might occur based on the attribute type and data). Hence,
The unique function in Python returns all the unique values for the specified
attribute of the data frame. This function not only returns the unique values
To visualize the unique value counts for each data field, initially import the
seaborn library.
The above function displays a simple normal graph plotted to visualize the
Enhancing the quality of our data is very necessary. To check for the null
This function returns the total number of null values under each attribute. If
there are no null values, the function returns zero. That does not mean the
attribute has one null value, but the attribute has no null values.
Here, nan refers to the null values. This function replaces each null value in
the whole data with zero. There are many optimized methods for replacing
null values, like using the mean or median of the entire column and
Attribute Datatypes
data. Dtypes
Use the above function to specifically know the data's datatype for all the
columns (attributes).
Data Filtration
When the data is extensive, but the required data is on a small scale, data
filtration is one of the best choices. This function returns the values
belonging to the class of that particular attribute. So, the required data is
Plotting
data [ [‘attribute_name ] ]. type_of_plot()
This function displays the graph of the variables of the mentioned type.
Correlation
data. corr()
A table of the correlated values for each attribute is displayed in matrix
concept that estimates the degree to which two defined variables move
concerning each other. The correlation matrix values will usually lie
denotes a high positive correlation. The methods mentioned earlier are the
analysis.
Bar charts are excellent for categorical data. Histogram is a bar graph where
each of the bars reflects the number of cases for a specific range of values.
They can therefore be used for categorical or continuous data. They aid in
they use reliable statistics like the median and interquartile range to provide
with each group representing a level of one variable and each bar indicating
and variables plotted on the x and y axes. Side-by-side box plots and bars
while scatter plots can accommodate multiple variables using different sizes
and shapes.
formulating questions for data science research (Shamim & Rihan, 2023).
evaluate and extract meaningful information from the data. Python libraries
like matplotlib and Seaborn provide tools for data visualization, enabling us
These lists of plots display every observation in the data and reveal how the
examine various enumerative plots. Let us consider the “Iris dataset” for
understanding the types. The dataset columns are sepal width, length, and
Univariate scatter plot helps plot various observations of the same variable
plot, the scatter() function needs two parameters. Therefore, plotting the
observations kept as the data frame's index (df.index). Then, using the
considering its diversity. Let us consider that we are plotting the 'sepal
length(cm)' variable:
The data is visualized in a line plot using line segments to connect the data
points. It looks like a scatter plot, but the measurement points are joined by
straight-line segments and are organized differently (usually by their x-axis
By default, the matplotlib plt.plot() method uses a line plot to plot the data.
Although matplotlib does not offer such an automated option, one can
utilize pandas' groupby() function to plot such a graph. The line plot can
Strip-Plots
Both scatter and strip plots are comparable. Strip plots are frequently used
with a few other plot types for more accurate analysis. These plots display
continuous variable is the swarm plot, which resembles a strip plot. The
sole difference between the swarm-automatic plot and the strip plot, which
Histograms
sample data. It also aids in our comprehension of the data's skewness and
Figure 5. Histogram
Density Plots
estimate the density of the entire data set smoothly. Plotting the density plot
distribution. Each data point has vertical lines in it. The height, in this case,
is arbitrary. The density of the tick marks can be used to determine the
distribution's density. The rug plot and histogram are directly related since a
histogram makes bins with data range, and then a bar is drawn with a height
equal to the ticks count in each bin. In the rug plot, each data point is
represented by a single tick mark or line on a single axis. The rug plot's
A box plot is a beneficial and standard method when depicting the data
the data distribution. Figure 8 illustrates the representation of the Box Plot.
Earlier, the seaborn library's distplot() function was mentioned in the rug
plot portion. The seaborn kdeplot() and rugplot() functions are combined
with the matplotlib hist() function in this function. Figure 9 showcases the
With a rotating kernel density plot on either side, the box plot resembles the
violin plot. In order to allow for comparison, it displays the diversity of data
parameter “show medians” to “True” to mark the medians for each variable.
The violin plot aids in comprehending the estimated density of the variable.
axis, which displays the category, is the first axis. The value axis, which
the bar, is the second axis. A category variable is shown on the plot. Bar()
produces a bar graph. A series holding the counts of the variable's unique
dimensional axis depiction of univariate data. The first axis is the category
axis, which displays the category, and the second axis is the value axis,
bar plot.
The most popular method for representing the numerical percentages held
option will then add the labels. The DataFrame.sample() function can be
can use Python string formatting to display the percentage value using the
When it's necessary to investigate the link between two distinct variables,
bivariate analysis is utilized (Dugard et al., 2022). In the end, this is what
analysis is the process of combining more than two variables for analysis.
For both Bivariate and Multivariate Analysis, will work on several charts.
More variables are taken into account at once in multivariate analysis. Only
Three categories of visual methods can be taken into account for bivariate
analysis:
shows the location where the two variables overlap, is the most typical
Scatter Plot
Using a scatter graph or plot to show the association between two numerical
between the overall cost and the tip given. Figure 13 illustrates the
There are several plots that can be used for bivariate and multivariate
al., 2019).
Bar Plot
the x-axis, a bar plot is a simple graphic that may be used to investigate the
Boxplot
(given in Figure 16). There is no hue option in Distplot, but can add one.
to the age range of death ratio and want to see the chance of persons with an
age range that of survival probability. The graph is clearly quite intriguing,
as can see in Figure 16. The orange plot depicts the likelihood of survival,
whereas the blue one displays the likelihood of dying. If observed, can see
that children have a larger chance of surviving than dying, however it is the
There are several plots which can be used for bivariate and multivariate
Heatmap
Heatmap is a visual depiction of only that, if you've ever used the crosstab
many people survived and perished can use the heatmap. Figure 17 provides
To comprehend the link between two categorical variables, can also use a
information from a vast array of data sets. EDA can be advantageous in this
regard for industries like data science, engineering, and research and
in a large number of complex data sets. From this chapter the various
libraries used in EDA could be known and various visualization could also
REFERENCES
Adams, B., Baller, D., Jonas, B., Joseph, A. C., & Cummiskey, K.
doi:10.1109/ICAEEE54957.2022.9836434
data, 61-139.
using R: quantitative tools for data analysis and data science. John
doi:10.4324/9781003343097
Harris, C. R., Millman, K. J., Van Der Walt, S. J., Gommers, R.,
Virtanen, P., Cournapeau, D., Wieser, E., Taylor, J., Berg, S.,
Smith, N. J., Kern, R., Picus, M., Hoyer, S., van Kerkwijk, M. H.,
Brett, M., Haldane, A., del Río, J. F., Wiebe, M., Peterson, P., &
Khandare, A., Agarwal, N., Bodhankar, A., Kulkarni, A., & Mane,
2022, 157–177.
Lafuente, D., Cohen, B., Fiorini, G., García, A. A., Bringas, M.,
doi:10.1021/acs.jchemed.1c00142
doi:10.1080/03772063.2023.2218317
CHAPTER 7
https://orcid.org/0000-0001-5405-5320
https://orcid.org/0000-0003-1666-2001
ABSTRACT
and provides operations and tools to interface with these arrays. NumPy
INTRODUCTION
NumPy is an essential package for systematic computing in Python. The
analyzing complex networks, data science, and big data; analyzing and
visualizing the networks using Python offers good insights about the
This encapsulates n-dimensional arrays of the same data types, with many
arrays and matrices). The ndarray object is at the heart of the NumPy
arrays and matrices. NumPy aims to deliver an array object faster than
traditional Python lists. As a result, Python is the fastest to read fewer bytes
and has the benefits of single instruction multiple data vector processes
(SIMD). In addition, NumPy completely supports an object-oriented
methods in the outermost NumPy namespace. This lets the languages code
Installing Numpy
Importing Numpy
Importing Modules: To use the NumPy library in this chapter, import it into
the program. The NumPy module is often imported using the alias np.
import NumPy as np
After this, this chapter can access functions and classes in the NumPy
better readability (alias) of the code using NumPy. This is a widely adopted
NUMPY DATATYPES
quantities, they can represent any data type, such as scalars, vectors,
matrices, or tensors. They are similar to Python lists but can have multiple
Data that may be accessed using NumPy Scalar: A scalar is a single integer
with zero dimension, and NumPy has one. As a result, instead of Python int,
NumPy data types utilize collations such as uint8, int8, uint16, and int16.
Strings, objects, and complicated data types the user creates are also
supported.
Scalar
Scalar and NumPy are terms for single numbers with a dimension of zero.
As a result, this book chapter may pass the value to NumPy's array function
to generate a NumPy array that holds a scalar instead of Python's int types,
Vectors
Matrices
Tensors
NUMPY ARRAYS
sorting, shaping, and steps. The data sort shows the kinds of parts stored in
the memory requirements for each cluster element are the same (Harris, 16
September 2020). In Python, NumPy arrays are the standard way to store
and matrices are stored in NumPy arrays. The NumPy library has numerous
NumPy arrays. Even though the Python programming language has an array
data structure, it is less flexible, practical, and powerful than the NumPy
assigned to one piece of data, and the memory space needs to be partitioned
into precisely sized areas (Stefan van der Walt, 2021). Contiguous memory
allocation is now available: To ensure that memory space can be used, split
Figure 2 shows that the metadata areas are connected to the NumPy array
data structure. Ordering an array using cuts is what b is about. These forms
give back a summary of the initial data. c. arrange an array using masks,
scalar aids, or other clusters in a way that duplicates the initial data. An
the ordering disputes before the lookup of the original data. The bottom
Less memory, faster, and more convenient. The Python NumPy array should
be the first option because it uses less memory than a list. Then, it is
In Figure 3, the list and Numpy array store data in memory. However, there
data types, but it can only store the basics of one data type.
• Data Types Storage: The list can store various data, while the Array
assembly to save data values and modify them quickly, which makes
Python. On the other hand, the outcomes are not shown in the list. Due
to this, math operations with the list are still possible but less practical
construction and hence can be resized and adjusted very rapidly and
ARRAY OPERATIONS
particular operations. The last session taught us how to access items. The
various functions that can be used with arrays are covered in this section.
Arithmetic Operations
applied to two collections. For example, combine two arrays, the first
element from the first Array will be added to the first element of the second
arrays:
Array Transpose
To reverse the tensor swap using the keyword argument, use transpose (an
Array Sorting
This involves pushing components in logical order. Any sequence with an
Every code that came before it only operated on individual arrays. On the
other hand, it is also possible to join many arrays into a single array, and it
arrays are concatenated, sequences are added one after the other in
sequential order.
Array Reshaping
can change the size of the Array, the number of elements in each, or both.
change the dimension as we want using rows and columns by changing the
indexes for its respective dimension. When the index is composed of the
targeted, completing the operation becomes quite simple. NumPy uses the
Broadcasting
may be carried out without a hitch so long as the two arrays being worked
of broadcasting.
Figure 7 shows that the trigonometric formulas for computing the sine,
The sin, cos, and tan functions return the trigonometric ratio for the
supplied angles.
Rounding Functions
number tuned to the accuracy of decimal digits. First, let us discuss the
This task returns the corrected decimal value at the desired decimal
can find each array element's minimum and maximum values along the
required axis.
NumPy Sorting and Searching
Numerous sorting and searching functions are available in Numpy. The sort
merge sort, and heapsort. The function call must specify the sorting
algorithm utilized in the sort operation. Let us talk about the sorting
While executing the functions, some return a copy of the input array, while
some return the view. When the contents are physically stored in another
location, it is called Copy. If, on the other hand, a different view of the same
values to its elements. Instead, it accesses it using the same id () used for the
changes that occur in one are immediately reflected in the other. For
example, if one changes its form, this will cause the other to alter its shape
as well.
CONCLUSION
the applications that may use its various packages. When using Python for
because of the nature of the computing tasks that Python is used for. It was
realistic array analysis. This chapter briefly introduces the NumPy library,
in Python, and it has the potential to serve as the basis for all other Python
arrays, was the topic of our discussion at the outset of this subsection. Then,
we looked at how the ndarray may be used to generate and manage arrays,
count orders, solve issues with data structures, carry out mathematical
arrays.
Users can design applications based on data structures, generate arrays with
N dimensions with the aid of this package, and adjust the geometry of
existing arrays. Users must consider every detail seriously to get any use out
of computers.
REFERENCES
357–362.
https://www.javatpoint.com/
Urayasu-shi.
Media, Inc.
doi:10.1109/MCSE.2011.36
Python:
https://www.digitalocean.com/community/tutorials/vectors-in-
python
Guide: https://numpy.org/doc/stable/user/whatisnumpy.html
Rajasrkaran Selvaraju
ABSTRACT
One of the powerful data types for programmers that a Python supports is a
items. Lists are useful to work with related data. A tuple is an immutable
data type that stores values in a sequence. Slicing can be used to get a range
of items. In Python, a set is variable that can store a variety of data, and
different data types perform different operations. A set data type in Python
one of the built-in data types where elements are key: value pairs. In other
arrays. Dictionaries are faster in execution, provide easy lookups, and are
Python.
INTRODUCTION TO LIST
structure that holds an ordered collection of items i.e., and you can store a
sequence of items in a list. The values in the list are called elements or
items. List values are accessed by using an index. The index value can be
positive from 0 or negative from -1. Once you have created a list, you can
add, remove or search for items in the list. Since we can add and remove
items, we say that a list is a mutable data type, i.e., this type can be altered
(Learn to code for IoT with python essentials course, 2022). Figure 1
Example
List1 = [10, 20,15.7, 30, 40.2]
List2 = ['Chocolate', 'Juice', 'Burger', ’Pepsi’]
List3 = [] #empty list
print(num[0]) → 2 print(num[-1]) → 5
print(num[2]) → 1 print(num[-3]) → 1
print(num[4]) → 5 print(num[-5]) → 2
Slicing a List
The slicing operation takes a specific range of elements from the list
colon.
Syntax
List_name[ start: end: step ]
Start is the starting index, End is the ending index (end value will be always
the previous value of end) Step is the increment or decrement value for
Example
myList[ 3: ] = ['d', 'e', 'f'] Elements from index 3 till the end
'f']
Input to a List
Quite often, we need to give some input to a list. An input() can be used to
Example
newlist=[] #Empty list
for idx in range(4):
val = int(input('Enter list value '))
#Take input
newlist.append(val) #append
value to list
print(newlist) #Print all
list values
NESTED LIST
A List can have another list. The following code illustrates nested list and
printing values.
Example
list_one = [10, 20, 12, [5, 9, 4], 17]
print(list_one)
print(list_one[3])
print(list_one[3][1])
Output
LIST METHODS
Table 4 presents the exercise for Lists, including the associated questions.
Question Answer
nd th
Print 2 to 5 Value
th nd
Print 6 to 2 value from reverse
We can have a user-defined function that takes the list as an argument and
perform some operation. For example, the following code Initializes a list
Example
Practical Exercises
1. Read five values to the list and print the square root of each value.
2. Read seven integer values to the list and count number even
numbers.
3. Read six integer values to the list and count the number of positive
numbers.
4. Read seven integer values. Find average. Find and print the number
INTRODUCTION TO TUPLE
A Tuple data structure is used when we have data that will not change over
parenthesis ‘(‘ and ‘)’. The three features of the tuple are immutable,
indexed, and heterogeneous. Tuple can have duplicate values (Guttag, 2021;
Example
#working with tuples
student = ('76J1235',”Ahmed”, 'Bachelor',3.2)
print(“Student ID : “, student[0])
print(“Student name : “, student[1])
print(“Student level : “, student[2])
print(“Student grade score : “, student[3])
print(“Length of tuple = “, len(student))
Output:
Student ID : 76J1235
Student name : Ahmed
Student level : Bachelor
Student grade score : 3.2
Length of tuple = 4
In this example, student is the name of the tuple. The above example creates
a tuple with four values. Tuple values are accessed using index student[0]
refers to ‘76J1235’ and student[3] refers to 3.2. Positive index starts from 0,
Example
student = ('76J1235',”Ahmed”, 'Bachelor',3.2)
for idx in student:
print (idx)
TUPLE SLICING
Arulkumar, 2020).
Example:
Table 5 provides examples of tuple slicing, including the input, output, and
student[1::2] ('Ahmed', 3.2) the tuple), move until end of tuple with
step 2.
(3.2, 'Bachelor',
'76J1235')
('Bachelor',
student[-2::-2] Starting index -2, step 2
'76J1235')
Example:
#Tuple packing
student = ('76J1235',”Ahmed”, 'Bachelor',3.2)
#Tuple unpacking
(sid, name, level, grade) = student
print('student name is: ', name)
print('student grade is: ', grade)
Tuple Examples
mark1 = (7,8,6,17,42)
print(“maximum value in tuple is “, max(mark1))
print(“Minimum value in tuple is “, min(mark1))
print(“Length of tuple is “, len(mark1))
mark2 = sorted(mark1)
print(“Before sorting: “,mark1, ” After sorting:”,
mark2)
print(type(mark1), type(mark2))
name1 = (“Ahmed”, “Rashid”, “Omar”)
name2 = (“ahmed”, “rashid”, “omar”)
print(“NAME1 = “, name1, ” NAME2 = “, name2)
print(name1 == name2)
print(name1 < name2)
print(name1 > name2)
NESTED TUPLES
Example
Searches the tuple for a specified value and returns the position of the value.
Christian, 2020).
Example
#initialize a tuple
tp = (2, 8, 5, 8, 7, 3, 6, 5, 1)
print(“count(8) = “, tp.count(8))
print(“count(3) = “, tp.count(3))
print(“count(4) = “, tp.count(4))
print(“index(7) = “, tp.index(7))
#Value to search, starting index, End index
print(“index(5) = “, tp.index(5,0,4))
count(8) = 2
count(3) = 1
count(4) = 0
index(7) = 4
index(5) = 2
INTRODUCTION TO SET
order every time you use them and cannot be referred to by index or
key)
3. set doesn’t have duplicate values (If items appear multiple times,
4. set values are unchanged (we cannot change the items after the set
has been created) set items are unchangeable, but you can remove and
Example
#initializing and printing a set
myset = {10, 8, 12, 7, 11}
myset2 = {'Oman', 'Iraq', 'USA', 'India'}
print(myset)
print(myset2)
Example:
The initialization statement myset2 has multiple entries for ‘Iraq’. The
property of set is ‘No duplicate values’. However, ‘Iraq’ and ‘iraq’ are
different.
SET METHODS
Difference.
Return a set.
course1 =
union Combination (union) of
itcourses.union(buscourses)
two given sets
not.
subset of set-2
superset of set-2
st = {'Apple', 'Banana'}
while True:
print(“ 1. Add to set \n 2. Print Set \n 3.
Delete from set \n Other to Exit”)
ch = int(input(“ Select one choice”))
if ch==1:
v = input('Enter fruit name to insert ')
st.add(v)
elif ch==2:
print(' **** Fruit Set has ....')
print(st)
elif ch==3:
a = input(' Enter fruit name to delete ')
if a in st:
st.discard(a)
print(' **** delete success ')
else:
print(“ *** No fruit available in
set”)
else:
print(' ****** Exit choice ')
break
INTRODUCTION TO DICTIONARY
Example:
strength = {
“java” : 25,
“python”: 24,
“sql” : 19,
“php” : 13
}
Here, strength is the name of our dictionary with four Key: Value pairs.
Now, it is very easy for us to access dictionary values. Even the value can
be changed using key. A key: value can be deleted from the dictionary. A
CREATING A DICTIONARY
Example
#Empty dictionary
course = { }
#Empty dictionay using dict method
courseone = dict()
#dictionary with pre inserted values
coursetwo = {'math':30, 'physics': 24}
#dictionary with integer keys
mymark = {7: 'quiz', 10: 'test', 40: 'final'}
#dictionary using dict method
myaddress = dict({'street': 'alaqdar',
'city':'iraq'})
mycar={
“brand”:”Hyundai”,
“model”:2022,
“color”:”red”
}
print(“car details “, mycar)
print(“car has “, len(mycar), ” items”)
print(“data type is “, type(mycar))
mycar is the name of the dictionary with three Key: Value pairs.
length of dictionary.
To get the value of a mycar key, we can use the following ways.
M = mycar['brand']
M = mycar.get('brand')
However, dictionary values can be changed as mycar['brand'] = 'Toyota'
Example
The above code generates the following output. Off course, it prints all keys
and values.
Besides, the following methods are used to get keys and values of
dictionary.
ky = mycar.keys()
val = mycar.values()
print(“Dictionary keys are “, ky)
print(“Dictionary values are “, val)
if “model” in mycar:
print(“Model is one of the key in dictionary”)
else:
print(“Model is not a key “)
mycar[“price”]=2700
mycar[“engine”]=”1600CC”
Method-1:
mycar.pop(“price”)
Method-2:
mycar.popitem(“price”)
Method-3:
del mycar[“brand”]
del mycar
DICTIONARY METHODS
Table 8 showcases a range of dictionary methods along with accompanying
CONCLUSION
A list is a flexible data type that can have heterogeneous items. List items
are accessed through index number. This chapter emphasizes list operations.
A list can be nested within another list. Tuples are used to group
tuple. Tuple values are accessed by index. This chapter covers tuple
This chapter concisely explains set properties and practical methods in our
daily programming life. Although the set has advantages, it has a few
limitations too. For example, a set can’t be embedded in another set. Also, a
set can’t have a list. A dictionary is a Key: Value pair that doesn’t allow
REFERENCES
Applications, 205-228.
Publishing. doi:10.1007/978-3-319-28316-6
Apress. doi:10.1007/978-1-4842-4246-9
Kong, Q., Siauw, T., & Bayen, A. (2020). Python programming and
Press.
Networking Academy.
https://www.netacad.com/courses/programming/pcap-
programming-essentials-python
doi:10.1142/S1793962322410069
Springer. doi:10.1007/978-3-030-68952-0
CHAPTER 9
A. V. Sriharsha
https://orcid.org/0000-0003-4244-4243
Olimjon Yalgashev
Islom Mamatov
https://orcid.org/0000-0002-7029-5890
ABSTRACT
scientists to quickly identify visual patterns and trends that may not be
models that are easier for stakeholders to understand and apply. Data
module for Plotly library that provides simple interface for visualizing data
in the form of various plots, maps, graph objects, layouts, traces, figures,
visualizations.
plots, graphs, charts, and maps, that may be used to explain the data and
and correlate data to confirm complicated ideas and spot visual patterns
quickly identify visual patterns and trends that may not be immediately
apparent from raw data. By presenting data visually, data scientists can
critical aspects of the data set can be highlighted while still conveying its
complete story. This makes it easier for business analysts to interpret the
talent for all managers in this era. Data visualization is an essential tool for
structure of the data. This helps us form hypotheses about what might be
techniques, we can more quickly and easily explore large data sets than
wrapper module for the Plotly library that provides a simple interface for
visualizations; for example, the Plotly figures are by default appended with
Matrix or Image
imshow
Input
density_mapbox
Plotly Express can create entire figures at once, thus reducing the burden on
since the API for these functions was deliberately created to be as consistent
of plots that Plotly Express supports. The Plotly Express API for multiple
plots, maps, graph objects, layouts, traces, and figures can be found at
(Python API reference for Plotly Express, 2022). Plotly Express has various
This section presents a brief overview and sample Python code snippets for
various types of plot visualizations – Scatter plot, Dot plot, Line plot, Area
plot, Pie chart, Bar chart, Grouped bar chart, Stacked bar chart, Sunburst
Scatter Plot
The scatter plot is one of the types of relationship plot. A scatter plot
scatter plot can visually inspect the linear correlation between any two
variables. Also, it allows us to visualize when one of the two variables is
mathematicians with a solid beginning point for their research when they
can quickly see how the two variables relate. The following Table 2 is the
sample code snippet for visualizing the scatter plot for the considered data.
2 import plotly.express as px
3 import pandas as pd
5 “Weight”.
data = [[“Male”,180,84],[“Female”,150,60],[“Female”,154,55],
[“Male”,169,78],[“Male”,170,84], [“Female”,157,56],
[“Female”,164,65],[“Male”,165,69], [“Male”,172,73],
6 [“Female”,169,85],[“Male”,151,48]]
9 “Weight”])
11 “Gender”,
13 fig.update_traces(marker=dict(size=12,line=dict(width=2,
color= “DarkSlateGrey”)))
fig.show()
(Lines 2 & 3). A dataset has been created of twenty individuals with their
with the dataset “data”, and the column names have been set for the
The marker color and the market shape are set differently based on Gender
This trick allows to include of a third dimension, “Gender” into the scatter
plot. The update_traces() function is used here to set marker size, marker
border line width, and marker border line color (Line 11). The show()
function will visualize the figure (Line 13). The Plotly Express API for the
2022) (Plotly Express API for scatter plot, 2022). The Plotly Express API
for Creating and Updating Figures, 2022). Figure 1 shows the scatter plot
visualized using the above Python code snippet. Visual inspection shows
that the attributes “Height” and “Weight” are positively correlated. Once
the Plot is visualized, one can interact with the Plot by hovering the cursor
The dot plot is one of the variations of the scatter plot. A scatter plot
a scatter plot. The following is the sample code snippet for visualizing the
dot plot for the considered data. The categorical variable “Gender” is
considered on the x-axis of the Plot, and the numerical variable “Weight” is
considered on the y-axis of the Plot. Figure 3 shows the dot plot visualized
using the below Python code snippet. Table 3 shows the code for Dot Plot.
2 import plotly.express as px
3 import pandas as pd
4 # Creating a dataset of individuals “Gender”, “Height” and
5 “Weight”.
data = [[“Male”,180,84],[“Female”,150,60],[“Female”,154,55],
[“Female”,164,65],[“Male”,165,69], [“Male”,172,73],
[“Female”,169,85],[“Male”,151,48]]
8 “Weight”])
10 “Gender”,
12 fig.update_traces(marker=dict(size=12,line=dict(width=2,
13 color= “DarkSlateGrey”)))
fig.show()
It is a plot between any two variables, and it shows the movement of change
following Table 4 is the sample code snippet for visualizing a line plot for
2 import plotly.express as px
3 import pandas as pd
5 data = [[“T1”,48],[“T2”,51],[“T3”,56],[“T4”,64],[“T5”,59],
[“T6”,69],
[“T7”,72],[“T8”,71], [“T9”,73],[“T10”,79]]
10
fig.show()
A dataset has been created of “Student 1” who has attempted ten tests (T1
created; it is initialized with the dataset “data”, and the column names have
been set for the dataframe (Line 7). “px.line()” function creates an entire
The show() function will visualize the figure (Line 11). The Plotly Express
API for the “line()” function can be referred to at (Plotly Express for line
plot, 2022) (Plotly Express API for line plot, 2022). Figure 4 shows the line
plot visualized using the above Python code snippet. By visual inspection, it
can be observed that the student has clearly improved his knowledge,
course.
This parameter sets a different color for each line drawn on the line plot.
The following is the sample code snippet for visualizing a line plot with the
third dimension for the considered data. The Table 5 code snippet draws
multiple lines based on the “Subject”. Figure 5 shows the line plot with the
encoding column color visualized using the below Python code snippet.
2 import plotly.express as px
3 import pandas as pd
5 data= [[“Biology”,”T1”,48],[“Biology”,”T2”,51],
[“Biology”,”T3”,56],
[“Biology”,”T4”,64], [“Biology”,”T5”,59],[“Biology”,”T6”,69],
[“Biology”,”T7”,72], [“Biology”,”T8”,71],[“Biology”,”T9”,73],
[“Biology”,”T10”,79],[“Chemistry”,”T1”,58],
[“Chemistry”,”T2”,51],
[“Chemistry”,”T3”,56],[“Chemistry”,”T4”,62],
[“Chemistry”,”T5”,64],
6 [“Chemistry”,”T6”,70],[“Chemistry”,”T7”,78],
7 [“Chemistry”,”T8”,75],
[“Chemistry”,”T9”,79], [“Chemistry”,”T10”,84]]
“Marks”])
10
fig.show()
color
Area Plot
Area plots are similar to line plots. First, the lines are drawn, and then the
area between the lines and the axes is filled. Hence, these plots are called
filled area plots. Generally, these plots are used to visualize multiple
variables' data trends over time. The filled areas can be overlapped or
stacked one over the other. These graphs are the standard approach to show
stacked lines and often indicate accumulated totals over time. The following
Table 6 is the sample code snippet for visualizing a filled area plot for the
considered data.
2 import plotly.express as px
3 import pandas as pd
5 data= [[“Biology”,”T1”,48],[“Biology”,”T2”,51],
[“Biology”,”T3”,56],[“Biology”,”T4”,64],[“Biology”,”T5”,59],
[“Biology”,”T6”,69],[“Biology”,”T7”,72],[“Biology”,”T8”,71],
[“Biology”,”T9”,73],[“Biology”,”T10”,79],[“Chemistry”,”T1”,58],
[“Chemistry”,”T2”,51],[“Chemistry”,”T3”,56],
[“Chemistry”,”T4”,62],
[“Chemistry”,”T5”,64],[“Chemistry”,”T6”,70],
[“Chemistry”,”T7”,78],
[“Chemistry”,”T8”,75],[“Chemistry”,”T9”,79],
6 [“Chemistry”,”T10”,84]]
fig.show()
A dataset has been created of “Student 1” who has attempted ten tests (T1
has been created, it is initialized with the dataset “data”, and the column
names have been set for the dataframe (Line 7). “px.area()” function creates
The Plotly Express API for the “area()” function can be referred to at (Plotly
Express for filled area plot, 2022) (Plotly Express API for filled area plot,
2022). Figure 6 shows the filled area plot visualized using the above Python
code snippet. By visual inspection, it can be observed that the student has
Pie Chart
proportional contribution of that category to the whole, i.e., each slice in the
pie chart represents a proportion of data of each type. Using a pie chart, the
7 is the sample code snippet for visualizing a pie chart for the considered
data.
2 import plotly.express as px
3 import pandas as pd
7 gender_distribution = pd.DataFrame(data,
columns=[“Gender”, “Population”])
9 fig = px.pie(gender_distribution, values=”Population”,
names=”Gender”,
10
fig.show()
“data”, and the column names have been set for the dataframe (Line 7).
“px.pie()” function creates an entire figure with a pie chart (Line 9).
The Plotly Express API for the “pie()” function can be referred to at (Plotly
Express for pie chart, 2022) (Plotly Express API for pie chart, 2022). Figure
7 shows the pie chart visualized using the above Python code snippet. By
visual inspection, it can be observed that the male population in the country
Bar Chart
Bar charts can be used for displaying metrics of categories of data (Sievert,
2020). Bar charts can help compare multiple types of data or discrete data,
provided there aren't too many categories to compare. The values are
compared over time between the various groups using the bar chart. To
track changes over time, bar graphs are utilized. For time series data, they
are highly beneficial. The bars on the bar chart can be drawn horizontally or
vertically. On the bar chart, each bar on the x-axis (or y-axis) represents a
category. All the bars have uniform width (or height). The bar's height (or
length) represents the category's value or metric on the y-axis (or x-axis). A
data. Bar charts show the relationship between any two dimensions. On one
discrete values. The following is the sample code snippet for visualizing a
bar chart for the considered data. There is one category in the data – “Year,”
and the statistical value for each class is the “Population.” In the following
code, the category “Year” is taken on the x-axis, and the y-axis represents
the statistical data of each “Year.” The height of the bar on the chart denotes
the “Population” value for each “Year,” while the width of the bar indicates
the “Year” itself. Table 8 has the code for bar chart.
[“2022”,333.39]]
6
# Creating a dataframe with data and column names
7
population = pd.DataFrame(data, columns=[“Year”, “Population”])
8
# Creating the bar chart
9
fig = px.bar(population, x=”Year”, y=”Population”,
10
# Setting the scale of the y-axis
11
fig.update_layout(yaxis_range=[325,335])
12
# Displaying the bar chart
13
fig.show()
country per year (in millions) (Line 5). A dataframe “Population” has been
completed; it is initialized with the dataset “data”, and the column names
have been set for the dataframe (Line 7). “px.bar()” function creates an
The Plotly Express API for the “bar()” function can be referred to at (Plotly
Express for bar chart, 2022) (Plotly Express API for bar chart, 2022). The
update_layout() function is used to set the y-axis range. The y-axis scale
the bar chart visualized using the above Python code snippet. By visual
inspection, it can be how the population in a country has increased over the
bar chart, visualized as a grouped bar chart. The following is the sample
code snippet for visualizing a bar chart for the considered data. There are
two categories in the data – “Year” and “Gender,” and the statistical data is
the “Population.” In the following code, the category “Year” is taken on the
x-axis, and the y-axis represents the statistical data of each “Year.” The
height of the bar on the chart denotes the “Population” value for each
“Year,” while the width of the bar indicates the “Year” itself. The other
grouped for each “Year” on the x-axis, i.e., in the grouped bar chart, the
bars representing the third dimension “Gender” are grouped for each x-axis
value “Year”. Table 9 has the code for Grouped Bar chart.
2 import plotly.express as px
3 import pandas as pd
USA
[“2020”,”Male”,164.21], [“2020”,”Female”,167.29],
[“2021”,”Male”,164.38], [“2021”,”Female”,167.51],
[“2022”,”Male”,165.13], [“2022”,”Female”,168.26] ]
gender_distribution = pd.DataFrame(data,
10
fig.update_layout(yaxis_range=[160,170])
12
fig.show()
country per year (in millions) and Gender (Line 5). A dataframe
“data”, and the column names have been set for the dataframe (Line 7).
“px.bar()” function creates an entire figure with a bar chart (Line 9).
Figure 9 shows the grouped bar chart visualized using the above Python
code snippet. Observe that there are two bars visualized for each “Year” on
the x-axis (one bar representing one subcategory (“Male”, “Female”) of the
to 2022.
With one aesthetic distinction, the stacked and grouped bar charts are
“Gender,” are stacked one over another rather than being grouped side-by-
side. The following Table 10 has the sample code snippet for visualizing a
2 import plotly.express as px
3 import pandas as pd
4 # Creating a population distribution dataset per genders in USA #
[“2020”,”Male”,164.21], [“2020”,”Female”,167.29],
[“2021”,”Male”,164.38], [“2021”,”Female”,167.51],
[“2022”,”Male”,165.13], [“2022”,”Female”,168.26] ]
7 gender_distribution = pd.DataFrame(data,
text_auto=True)
11 fig.show()
Observe that in the bar() function, the mode of the bars (barmode=
representing the third dimension will be stacked rather than grouped. Also,
different patterns and shapes can be used to fill the bars along with the
color, if appropriate.
Only one bar represents each “Year” on the x-axis. Each subcategory
Sunburst Chart
shows discrete hierarchical data from the roots to the leaves. The root forms
the core (innermost circle) of the Plot. Then, outer rings are added to the
core as needed. One ring or circle represents each hierarchy level, with the
innermost circle acting as the parent or root for all the data. Subsequent
rings are divided into slices, and the size of each slice is proportional to the
data value. Each ring demonstrates how the outer rings relate to the interior
rings.
The following Table 11 has the sample code snippet for visualizing a
“Concert”,”Gym”,”Brunch”,”Family Meet”],
day=[“Saturday”,”Saturday”,”Saturday”,
“Saturday”,”Saturday”,”Saturday”,”Sunday”,
“Sunday”,”Sunday”],
hours=[1, 3, 2, 2, 1, 6, 2, 4, 4])
6
# Creating the sunburst plot
7
fig = px.sunburst(data, path = [“day”, “event”],values=”hours”)
8
# Displaying the sunburst plot
9
fig.show()
The attribute “day” is the sunburst plot's root (or core). The attribute
nd
“event” forms the outer ring (2 level). The attribute “day” includes the
nd
data values that decide the size of each slice in the 2 level ring.
“px.sunburst()” function creates an entire figure with a bar chart (Line 7).
The parameters for the “px.sunburst ()” function are set as follows –
Express for sunburst chart, 2022) (Plotly Express API for sunburst chart,
2022). Figure 11 shows the sunburst chart visualized using the above
Density Heatmap
colors on the color scale represent richer density levels, and sparse density
levels are represented by lighter colors on the color scale. The following
Table 12 has the sample code snippet for visualizing a density heatmap for
2 import plotly.express as px
3 import pandas as pd
5 data= [[“Biology”,”T1”,48],[“Biology”,”T2”,51],
[“Biology”,”T3”,56], [“Biology”,”T4”,64],[“Biology”,”T5”,59],
[“Biology”,”T6”,69], [“Biology”,”T7”,72],[“Biology”,”T8”,71],
[“Biology”,”T9”,73], [“Biology”,”T10”,79],[“Chemistry”,”T1”,58],
[“Chemistry”,”T2”,51],
[“Chemistry”,”T3”,56],[“Chemistry”,”T4”,62],
[“Chemistry”,”T5”,64],
[“Chemistry”,”T6”,70],[“Chemistry”,”T7”,78],
[“Chemistry”,”T8”,75], [“Chemistry”,”T9”,79],
6 [“Chemistry”,”T10”,84]]
11 “Marks”,
fig.show()
A dataset has been created of “Student 1” who has attempted ten tests (T1
has been created, it is initialized with the dataset “data”, and the column
names have been set for the dataframe (Line 7). “px.density_heatmap()”
at (Plotly Express for density heatmap, 2022) (Plotly Express API for
observed that the student has clearly improved his knowledge, performed
well, and has shown considerable improvement in both aggregated courses.
Also, it can be observed that the student has performed well in the
CONCLUSION
wrapper module for the Plotly library that provides a simple interface for
visualizations; for example, the Plotly figures are by default appended with
hover text which the programmer can customize. More than 30 functions
are available in Plotly Express to create various types of plots, maps, graph
it is simple to transition between multiple kinds of plots since the API for
Various types of plot visualizations such as Scatter plots, Dot plots, Line
plots, Area plots, Pie charts, Bar charts, Grouped bar charts, Stacked bar
charts, Sunburst charts, and Density heatmaps have been presented and
REFERENCES
Press.
Plotly and Dash: Harness the power of a fully fledged frontend web
from https://plotly.com/python-api-
reference/generated/plotly.express.bar.html
from https://plotly.com/python/bar-charts/
https://plotly.com/python/creating-and-updating-figures/
reference/generated/plotly.express.density_heatmap.html
Plotly Express API for filled area plot. (n.d.). Retrieved September
reference/generated/plotly.express.area.html
Plotly Express API for line plot. (n.d.). Retrieved September 2022,
from https://plotly.com/python-api-
reference/generated/plotly.express.line.html
Plotly Express API for pie chart. (n.d.). Retrieved September 2022,
from https://plotly.com/python-api-
reference/generated/plotly.express.pie.html
reference/generated/plotly.express.scatter.html/
https://plotly.com/python/plotly-express/
610–646. doi:10.1111/cgf.13595
doi:10.1007/978-981-99-0135-7_8
CHAPTER 10
ABSTRACT
insights from large datasets. This research focuses on enhancing big data
INTRODUCTION
Big Data consists of vast data from diverse and independent sources,
to identify the most relevant and customized offers for users. These
applications.
reducing aggregate data size (Rajaraman & Ullman, 2012). Clustering and
collaborative filtering are the two primary phases of this procedure (Zheng
CLUSTERING
phase by limiting the number of services within a cluster relative to the total
(Zeng et al., 2010). Objects from the same category are more comparable
quality clusters characterized by high similarity within each cluster and low
RELATED WORK
dist plot those accounts for varying densities. This enables the simultaneous
uses the Local Outlier Factor (LOF) to distinguish noise, setting it apart
DBSCAN algorithm (Ram et al., 2013) that can account for variations in
local densities uniformly within a cluster and dividing local regions into
(Elbatta et al., 2011). This strategy entails identifying the “center” of each
Despite the emergence of the big data paradigm (Ishwarappa, 2011), it has
programming model (He et al., 2014), ideally suited for massive data
multiple regular grids and assigns data points to similar grids, thereby
points.
Given the obstacles mentioned earlier, He et al. (2014) proposed the MR-
skewed big data. The algorithm consists of three primary stages: data
partitioning, local clustering, and global merging. In addition, Dai and Li
developed the PRBP algorithm (Dai & Lin, 2012) to accomplish load
Das (Bhardwaj & Dash, 2015) developed a density-based approach for the
into their merging strategy can prevent clusters of varying densities from
with varying densities within each partition, albeit at the expense of some
inter-partition connectivity.
PROPOSED WORK
considerations for security and privacy. The advent of the data-driven model
and the ongoing revolution in Big Data present unique challenges that can
these vast datasets or data streams, referred to as Big Data mining, has
variability, and velocity of the data. The Big Data challenge represents an
exciting opportunity to shape the future landscape. The term “Big Data”
denotes datasets that exceed the capacity of our current systems and
traditional data mining software tools in terms of size and complexity. This
aims to assess the accuracy and completeness of the data, thereby ensuring
its reliability for further analysis. Data cleansing involves the elimination of
errors and the administration of missing values through the use of manual
Users may become frustrated and forsake their learning sessions if they find
requirements for these queries are then adjusted for all users. The second
outcomes may contain web pages, images, and other relevant files.
EXPERIMENTAL RESULT
The term “stem” in phonetics pertains to a constituent element of a word,
English word “fellowships,” the stem “companion” provides the base form,
essential to note that the original root of the word (in this case,
Within this article, the term “stem” refers to the shared portion of a word in
all its inflected forms. Hence, in this usage, all derivational affixes
contribute to the stem. For example, in the case of “friendships,” the stem is
objects so that objects within the same group, known as clusters, exhibit
data mining and serves as a standard procedure for statistical data analysis.
bioinformatics.
Performance Analysis
The Collaborative Filtering (CF) method encompasses various strategies,
retrieves and displays all associated images when a user searches for a
data analytics and machine learning tasks, making it an ideal choice for
and methods and can manage large-scale datasets, which are both necessary
for big data analytics. Python can also be used to implement the research-
methods described in the research paper. Its libraries, frameworks, and data
processing capabilities make it ideal for big data analytics, enhancing search
engine relevance, and enhancing user experience (Stančin & Jović, 2019).
big data analytics. These data structures facilitate the efficient storage,
• Lists: Lists are one of Python's most versatile and pervasive data
structures. They allow for the storage of heterogeneous data types and
enables efficient data access and retrieval based on unique keys. They
enormous datasets.
CONCLUSION
clustering and collaborative filtering for analyzing vast amounts of data and
offers a data mining-based method for managing vast data sets. The
based on user ratings within clusters. In addition, the study evaluated the
REFERENCES
Akbar, I., Hashem, T., Yaqoob, I., Anuar, N.B., Mokhtar, S., Gani,
A., & Khan, S.A. (2015). The rise of “big data” on cloud
computing: review and open research issues. Inf Syst., 47, 98–115.
Bellogín, A., Cantador, I., Díez, F., Castells, P., & Chavarriaga, E.
doi:10.1145/2414425.2414439
analytics. doi:10.1007/978-3-319-27057-9_10
Duan, L., Xu, L., Guo, F., Lee, J., & Yan, B. (2007). A local-
method for discovering density varied clusters. Int Sch Res Not.
Ester, M., Kriegel, H. P., Sander, J., & Xu, X. (1996). A density-
DBSCAN with Eps automatic for large dataset. Int J Adv Comput
1146. doi:10.1109/TFUZZ.2012.2201485
He, Y., Tan, H., Luo, W., Feng, S., & Fan, J. (2014). MR-
doi:10.1007/s11704-013-3158-3
Liu, P., Zhou, D., & Wu, N. (2007, June). VDBSCAN: varied
doi:10.1109/TSC.2009.11
doi:10.3115/1699510.1699544
doi:10.1109/CIT.2008.4594646
Parimala M, Lopez D, Senthilkumar N, (2011). A survey on
Ram, A., Jalal, S., & Kumar, M. (2013). A density based algorithm
of free Python libraries for data mining and big data analysis. In
doi:10.23919/MIPRO.2019.8757088
Wu, X., Zhu, X., & Wu, G. Q. (2014). Data mining with big data.
97–107. doi:10.1109/TKDE.2013.109
Zeng, W., Shang, M. S., Zhang, Q. M., Lü, L., & Zhou, T. (2010).
410. doi:10.1109/BigData.Congress.2013.60
CHAPTER 11
N. Arulkumar
ABSTRACT
WSNs due to the limited capacity of the batteries that power the sensors.
and sink nodes, are introduced. How Python libraries such as NumPy,
such as data aggregation, duty cycling, and power management, are also
INTRODUCTION
the network, the proposed approach seeks to improve the energy efficiency
of WSNs (Abdulzahra et al., 2023). The research uses relay sites to extend
This Study demonstrates, through extensive testing and analysis, that the
maintenance costs.
LITERATURE REVIEW
Specific constraints and needs determine the protocol choice for precision
(Bria, 2019; Roopitha & Pai, 2020). The T-MAC (Traffic-aware MAC)
based on parameters and factors for the dynamic environment in WSN. The
adaptive and dynamic to sustain the node's lifetime, as they currently do not
• Fixed cluster heads consume more energy to transmit data to the sink
node.
• Sleep/wake cycles are not regulated in the current scenario for data
transmission.
Problem Statement
based on parameters and factors for the dynamic environment in WSN. The
adaptive and dynamic to sustain the node's lifetime, as they currently do not
Primary Objectives
the network
models
Secondary Objectives
agriculture
METHODOLOGY
enhancing the energy efficacy of WSNs was the initial step. This analysis
sensors in strategic locations, taking into account crop types, terrain, and
After designing the WSN, the model was implemented and data collection
parties. This platform not only enabled real-time monitoring, but also
enhance the model. The collected data was analyzed to assess the efficacy
of various protocols and identify areas for enhancement. The data analysis
WSN
Its random cluster structure and cluster head rotation may help evenly
being selected as cluster leaders more often than others, resulting in uneven
Relay nodes are essential in wireless sensor networks (WSN). Relay nodes
are indispensable for extending the network's data transmission range and
more reliable data transmission over greater distances with reduced energy
arrangement
cluster heads in areas with a high node density or a clear line of sight
heads capture and transmit data from member nodes to the base station. The
cluster heads in areas with a high node density or a direct line of sight to the
base station.
evaluate the benefits and drawbacks of each strategy in the context of the
among the Sensor Node, Base Station, and Relay Node, providing an
The following steps are to implement relay nodes in WSN (Chauhan &
Soni, 2021).
out-of-range nodes
network performance
in return.
• The base station receives the data from the RelayNode and responds
relay nodes can assist in overcoming connectivity issues. These relay nodes
Using relay nodes increases network connectivity and decreases data loss
When relay nodes are in use, adaptive duty cycling can be used to optimize
adjust their duty cycle based on the proximity of relay nodes. When a relay
nodes. This strategy extends the network's lifetime and reduces the nodes'
maximum transmission range for sensor and relay nodes. Based on their
relative positions and transmission ranges, the code identifies all feasible
data transmission lines between sensor nodes and relay nodes and between
them. These data transmission paths are saved as tuples comprising the
coordinates of the transmitting nodes. The code then depicts the nodes and
data transmission lines using Matplotlib and displays the resulting graph.
agricultural field.
CONCLUSION
nodes in WSNs for extending the data transmission range and conserving
energy. Also discussed is the significance of adaptive duty cycling in
Study compares the energy consumption of WSNs with and without relay
into WSNs. Results indicate that integrating relay nodes into the network
scenario, the network's total energy consumption is 67.86 when relay nodes
are not used, which is higher than the energy consumption with relay nodes.
This indicates that incorporating relay nodes in the wireless sensor network
network.
REFERENCES
Bharany, S., Sharma, S., Badotra, S., Khalaf, O. I., Alotaibi, Y.,
algorithm with multi-hop routing via low degree relay nodes for
020-02385-1
Chen, S., Zhang, L., Tang, Y., Shen, C., Kumar, R., Yu, K., Tariq,
doi:10.1016/j.scs.2020.102333
102409. doi:10.1016/j.adhoc.2020.102409
Khriji, S., Chéour, R., & Kanoun, O. (2022). Dynamic Voltage and
doi:10.3390/electronics11244071
Kim, D. S., Tran-Dang, H., Kim, D. S., & Tran-Dang, H. (2019).
Things, 141-159.
Liang, H., Yang, S., Li, L., & Gao, J. (2019). Research on routing
doi:10.1109/ICISC47916.2020.9171085
Sarwar, S., Sirhindi, R., Aslam, L., Mustafa, G., Yousaf, M. M., &
doi:10.1109/ACCESS.2020.3021016
Su, Y., Lu, X., Zhao, Y., Huang, L., & Du, X. (2019). Cooperative
doi:10.1016/j.comcom.2019.10.006
CHAPTER 12
N. Arulkumar
https://orcid.org/0000-0002-9728-477X
ABSTRACT
tools for faster code writing and simplifies crypto analysis. Python allows
scripted language that does not require compilation. Different models such
and speedy language is needed for blockchain applications that enable chain
INTRODUCTION
In recent years, blockchain technology, the foundation of cryptocurrencies,
segments. The owner's digital signature on the ledger provides security and
ownership transfers.
healthcare, supply chain, and the Internet of Things (IoT) use centralized
technology of the future, and nations including Japan, Germany, and France
currencies and blockchain are still developing and will continue to do so.
Due to its high efficacy, robust security, and scalability, Python is the
including SVR, ARIMA, and LSTM, can be utilized to predict the price of
cryptocurrencies.
However, the volatility and unpredictability of cryptocurrencies can make it
LITERATURE REVIEW
that they could not be backdated or tampered. In 1992, Merkle Trees were
blockchains. The words block and chain were used separately in Satoshi
100 GB (Larrier, 2021). On the other hand, the idea for cryptocurrency first
began in the late 1980's, the idea was for a currency that could be sent
untraceable and in a manner that did not require centralized entities (i.e.,
cryptographic puzzles, and those who solved the puzzle received the reward
The Bitcoin system only provides eventual consistency. For everyday life,
Seidel, & Wattenhofer, 2014). In this paper we propose a new system, built
on the Bitcoin block chain, which enables strong consistency. Our system,
peer- to-peer network, and ultimately enhances Bitcoin and similar systems
with strong consistency. Our extensive analysis shows that Peer Census is in
a secure state with high probability. We also show how Discoin, a Bitcoin
solution, but the main benefits are lost if a trusted third party is still required
as the former's error was lower than the latter, giving more accurate
down, the model would report “the magnitude of the price change” (Critien
et al., 2022). The study leveraged not only historical price data for Bitcoin,
but also Twitter posts to glean public sentiment about the currency. An
which is a model composed of two LSTMs: one for historical price data and
one for Twitter posts. Its accuracy of 64.18% was achieved by using 450
cryptocurrencies such as Bitcoin would rise or fall in price. The study made
approach to predict the price of Bitcoin. In this study, the model's effective-
pseudonymous entity named Satoshi Nakamoto in 2009 but the real market
for cryptocurrency started in 2013. Today there is more than 1650 different
role, with increased demand driving prices up and oversupply causing them
features and utility attract more demand. Market liquidity, the ease of
buying and selling cryptocurrencies, can affect prices, with higher liquidity
and global events all contribute to the complex dynamics that shape
cryptocurrency prices. The parameters like MAE, RMSE, MSE, and MAPE
important to note that the choice of evaluation metrics may depend on the
PROBLEM STATEMENT
market.
Primary Objective
• To develop an integrated framework of multiple deep learning
Secondary Objectives
METHODOLOGY
The section that follows describes the research methodology used to achieve
1. Identify and Review: Review the existing models and methods for
databases.
from the existing ones to improve the predictive power of the models.
5. Split the Data: Divide the dataset into training, validation, and
testing sets. The training set will be used to train the prediction models,
the validation set to tune model hyperparameters, and the testing set to
transformer-based models).
11. Model Refinement: Iterate and refine the model based on the
further.
TOOLS
and has become a popular tool for predicting cryptocurrency prices. Python
offers several libraries, frameworks, and tools that facilitate data analysis,
Python is involved: Here are some key Python tools commonly used in this
context:
level APIs for building and training deep neural networks. These
where additional relevant features can be derived from the raw data.
This may include technical indicators, sentiment analysis scores, or
lagged values. Python libraries like Pandas make it easier to create new
libraries provide a rich set of tools for building and training deep
learning models.
prediction pipeline.
ANALYZING CRYPTO MARKET DATA WITH PYTHON
The code is separated into six portions: downloading the data and loading
Figure 1 provides the Python code necessary for loading the required
libraries.
For instance, the desired Crypto data for Binance, Bitcoin, Ethereum, and
BNB, BTC, ETH, and XRP (Shrivas, et al., 2022; Jamision et al., 2018).
example.
Figure 3. Python code: Loading crypto data from the beginning of the
COVID-19 pandemic
values in the data frame. Consequently, the analysis can proceed, but it
fluctuation of stock prices over time. Due to the varying scales, direct
pct_change() function.
showcasing the Graph with Return Plot, enhances the chapter by providing
• XRP exhibits the highest volatility, with Binance being the next most
the extent of price fluctuations in an asset (Molin & Jee, 2021). Figure
7, which presents the Python code for calculating the volatility and
computed based on return data to avoid biased results that can occur
the relationships between different digital currencies. The Python code for
• From the chart in Figure 10, it is evident that in mid-May 2021, the
upward trend.
CREATING OUR OWN CRYPTOCURRENCY USING
PYTHON
CONCLUSION
created coin may not meet the current market demands for stability,
efficient language.
REFERENCES
Aggarwal, S., & Kumar, N. (2021). History of blockchain-
Critien, J. V., Gatt, A., & Ellul, J. (2022). Bitcoin price change and
Academic Press.
100.
https://www.freecodecamp.org/news/create-cryptocurrency-using-
python/
https://www.simplilearn.com/tutorials/blockchain-
tutorial/blockchain-technology
https://www.analyticsinsight.net/top-10-useful-python-packages-to-
pull-cryptocurrency-data-seamlessly/
CHAPTER 13
N. Arulkumar
ABSTRACT
INTRODUCTION
Self-Supervised Contrastive Learning for Medical Images with Report
lists, and arrays store and process the data. To extract valuable insights from
Once the data representations have been learned, they can generate reports
2022).
LITERATURE REVIEW
has been a potential method for producing accurate medical reports and
diagnoses. TensorFlow and Keras are some of the tools and frameworks the
pyramid for 3D medical imaging using a non-skip U-Net and sub-crop. The
creation verify the model trained on 4.8 million CXR pictures. CheSS
1.3% on the CheXpert dataset. The article concludes that CheSS may help
collecting inaccessibility.
employed.
supervised learning.
RESEARCH GAP
abnormalities.
RESEARCH QUESTIONS
image annotation
learning in healthcare?
The study looks towards annotation for medical images using self-
cropping, rotation, flipping, and color jittering are high factors. The
the size of the contrastive loss batch, the learning rate, the quantity of
training data, the size of the embedding space, and the regularization
and parameters, which are essential in predicting sections of the input data
PROBLEM STATEMENT
The lack of accurate and robust labelling for medical images has been a
conditions.
Primary Objectives:
Secondary Objectives:
medical images
and models.
METHODOLOGY
The section that follows describes the research methodology used to achieve
the primary and secondary goals of this study, which is to develop a self-
generation.
The code is separated into two portions. The first phase consists of
while the second step employs the pre-trained VGG16 model to predict
picture labels. The code searches the internet for photos, downloads them,
adjusts their proportions, and eliminates broken images in the first stage. In
the second stage, the pre-trained VGG16 model is loaded, pictures are
processed for the model, predictions are generated, and probabilities are
displayed next to labels (Sharma et al., 2023; Jaishankar et al., 2022; Kiran
The following steps gather chest X-ray images and prepare them for use in
deep-learning models. The code searches the internet for images, downloads
them, modifies their dimensions, and removes broken images. The sample
Steps
URLs.
• Download the images using the retrieved URLs and save them in the
directory.
The provided code utilizes the pre-trained VGG16 model to predict labels
for a collection of chest X-ray images. The sample code is given in Figure 2.
Steps
• Set the path to the directory containing the chest X-ray images.
• Loop over each image file in the directory and load the image.
• Preprocess the image by resizing it to 224x224 and converting it to
an array.
Python is the programming language used to create the code. The code
making predictions using the model, and printing the predicted labels and
search for and download images, process the downloaded images, and load
the pre-trained model. These tasks are performed using Python (Alghamdi
Figure 3.
analyze data statistically, such as NumPy, pandas, and SciPy. This may
CONCLUSION
utilizing Python frameworks like PyTorch, TensorFlow, and Keras for Self-
imaging.
medical imaging reports and diagnoses can significantly impact patient care
reports.
REFERENCES
Alghamdi, M. M. M., Dahab, M. Y. H., & Alazwary, N. H. A.
Chen, L., Bentley, P., Mori, K., Misawa, K., Fujiwara, M., &
Cho, K., Kim, K. D., Nam, Y., Jeong, J., Kim, J., Choi, C., Lee, S.,
Lee, J. S., Woo, S., Hong, G.-S., Seo, J. B., & Kim, N. (2023).
doi:10.1007/s10278-023-00782-4
Kiran, S. V., Kaur, I., Thangaraj, K., Saveetha, V., Kingsy Grace,
Graphics.
Li, Z., Li, H., Ralescu, A. L., Dillman, J. R., Parikh, N. A., & He,
Moussaid, A., Zrira, N., Benmiloud, I., Farahat, Z., Karmoun, Y.,
MDPI.
doi:10.1007/978-981-19-7874-6_23
doi:10.1142/S1793962322410069
Saravanan, S., Lavanya, M., Srinivas, C. M. V., Arunadevi, M., &
357–366. doi:10.1016/j.procs.2023.01.018
496.
Zhou, H. Y., Lu, C., Chen, C., Yang, S., & Yu, Y. (2023). A Unified
doi:10.1109/TPAMI.2023.3234002
CHAPTER 14
N. Arulkumar
https://orcid.org/0000-0002-9728-477X
ABSTRACT
This chapter examines how Python can assist in predicting type 2 diabetes
using insulin DNA sequences, given the substantial problem that biologists
NumPy, Pandas, and Scikit-learn, for data handling, analysis, and machine
with other bioinformatics tools, like BLAST, EMBOSS, and ClustalW, can
help identify DNA markers that could aid in predicting type 2 diabetes. In
protein that contribute to diabetes prognosis and investigates the risk factors
INTRODUCTION
Diabetes is a chronic disease that affects millions of people worldwide and
health complications. The two most common types of diabetes are type 1
plans for diabetic patients and in preventing the onset of diabetes in those at
risk.
the disease. Alterations in the insulin gene sequence can contribute to the
learn are Python libraries that can preprocess and analyze DNA
research due to its simplicity and easy learning syntax. Using Python's
the DNA sequence data for insulin with other DNA sequences in a
model that classifies the DNA sequence of the insulin gene to identify type
Python's role in facilitating this research and demonstrate its value as a tool
• Input: Python can retrieve the DNA sequence for the insulin gene
• Python can divide data into train and test sets, a model training and
evaluation requirement.
predicting type 2 diabetes and validate the model using metrics such as
are just a few of Python's libraries for data manipulation, analysis, and
visualization tools, Python is now the preferred language for data analysis
Scikit-learn, the three most commonly used Python libraries for data
data and constructing and evaluating predictive models. NumPy and Pandas
are useful for preprocessing and analyzing DNA sequence data, whereas
Scikit-learn helps build predictive models. Python and its libraries provide a
biological data.
NumPy
(Yalçın, 2021).
Pandas
for reading and writing data in CSV, Excel, SQL databases, and JSON
table-like data structure with rows and columns. Pandas provides tools for
time-series data because it allows for tools for resampling, time shifting,
VISUALIZATION TOOLS
visualization tools, including line charts, scatter plots, bar charts, and
heatmaps. Using these tools, researchers can better understand the genetic
increases. Python offers vast libraries for data visualization, analysis, and
Matplotlib
graphs, bar charts, and heatmaps (Klasen et al., 2023). Matplotlib can be
Seaborn
DNA sequence data. Seaborn can be utilized, for example, to visualize the
ALGORITHMS IN PYTHON
This chapter examines five distinct machine learning approaches and how
they could be used to predict type 2 diabetes using the insulin DNA
the most important genetic factors associated with diabetes risk, unlike
extract pertinent traits from DNA sequence data to predict the likelihood of
similarity.
Logistic Regression
Logistic regression is a standard statistical technique for predicting results
may be used to determine the relationship between the DNA sequence and a
the insulin DNA sequence (Klarin et al., 2019). The existence or absence of
type 2 diabetes would result from the dependent variable in this situation,
regression may also be used to assess the model's efficacy. These criteria
may be used to assess the model's propensity for prediction and clinical
a higher risk of acquiring diabetes may be found using the decision tree
The right drugs may be given to patients with a high risk of acquiring
Random Forest
improve the model's predictive accuracy. The forecasts of all the individual
decision trees, each trained using a random sample of the data and
In the context of disease prediction using the Insulin DNA sequence, the
a dataset including the DNA sequences of persons with and without Type 2
Diabetes and other relevant clinical data. A set of traits in the DNA
variant. The Random Forest approach may then be used to identify the
plans for those more likely to get the ailment. Random forests are typically
medical diagnostics.
Machine learning techniques like the K-NN algorithm are used for
the similarity of their DNA sequence to other known DNA sequences in the
first step is to gather a large dataset of DNA sequences from people who are
either diabetic or not to employ the k-NN technique for this. The next step
would be to identify relevant qualities from these DNA sequences that may
The K-NN approach trains a model on the dataset after collecting features.
dataset and then utilizes the neighbors' class labels to predict the class label
for the new sequence. When determining the value of k, the size of the
dataset and the needed degree of precision are often considered. The K-NN
predictions will depend on the quality and volume of the dataset, the
In order to predict Type 2 Diabetes using the insulin DNA sequence, CNNs
may be utilized to extract relevant traits from DNA sequence data. Using a
CNN, the system may automatically find connections and patterns in DNA
sequence data that would not be apparent to the human eye. The DNA
nucleotides (A, C, G, and T) as an input to the CNN. The CNN will next
sequence data. Fully connected layers may further analyze these data to
important patterns and links in the data that may not be immediately
LSTM. LSTM algorithms may analyze the sequential data and provide
may have significant patterns or links spread across the sequence at various
locations. They are often relatively lengthy and complex. These tendencies
The insulin DNA sequence may be seen as a time series using the
time step. The patterns and connections it discovers in the sequential data
may then be used to train the LSTM to predict whether or not a person has
and patterns over many time steps may be pretty helpful for investigating
in the presence of missing data, which often happens with data from DNA
BIOINFORMATICS TOOLS
markers associated with type 2 diabetes. This section will explain the three
well-known bioinformatics software BLAST, EMBOSS, and ClustalW, and
how they may be used with Python to find DNA markers (Lo, 2023).
BLAST
sequences. Users may utilize BLAST capability inside Python by using one
of people with and without type 2 diabetes using BLAST, which one day
might be used as DNA markers for the condition. Researchers may quickly
EMBOSS
biology tasks, including protein and sequence analysis. Among the more
than 200 tools EMBOSS offers are sequence alignment, protein structure
from Python using the PyEMBOSS module for EMBOSS. In the context of
sequence analysis.
ClustalW
act as DNA markers for the condition. Researchers can quickly compare and
CONCLUSION
may develop exact models for predicting the chance of developing diabetes
This insight may make the development of more potent treatments and
Seaborn and Matplotlib, researchers may find patterns in patient data and
REFERENCES
Alzubaidi, L., Zhang, J., Humaidi, A. J., Al-Dujaili, A., Duan, Y.,
859. doi:10.1016/j.cmet.2020.08.007
doi:10.1038/s41574-020-0355-7
Hao, J., & Ho, T. K. (2019). Machine learning made easy: A review
doi:10.3102/1076998619832248
J. P., Halford, J. L., Weng, L.-C., Nauffal, V., Roselli, C., Hall, A.
Bai, X., Balasubramanian, S., Baras, A., Beechert, C., Boutkov, B.,
doi:10.1038/s41588-021-01011-w
Klarin, D., Lynch, J., Aragam, K., Chaffin, M., Assimes, T. L.,
Huang, J., Lee, K. M., Shao, Q., Huffman, J. E., Natarajan, P.,
Arya, S., Small, A., Sun, Y. V., Vujkovic, M., Freiberg, M. S.,
Wang, L., Chen, J., Saleheen, D., Lee, J. S., & Damrauer, S. M.
1279. doi:10.1038/s41591-019-0492-5
Klasen, V., Bogucka, E. P., Meng, L., & Krisp, J. M. (2023). How
doi:10.1080/23729333.2022.2156316
Li, J., Chen, Q., Hu, X., Yuan, P., Cui, L., Tu, L., Cui, J., Huang, J.,
Jiang, T., Ma, X., Yao, X., Zhou, C., Lu, H., & Xu, J. (2021).
doi:10.1016/j.ijmedinf.2021.104429
Li, X., Zhang, Y., Leung, J., Sun, C., & Zhao, J. (2023).
Academic Press.
doi:10.1007/978-3-030-53829-3_20
Rather, M. A., Agarwal, D., Bhat, T. A., Khan, I. A., Zafar, I.,
doi:10.1016/j.ijbiomac.2023.123549
doi:10.1111/coin.12318
Adams, B., Baller, D., Jonas, B., Joseph, A. C., & Cummiskey, K.
doi:10.1109/ICAEEE54957.2022.9836434
Akbar, I., Hashem, T., Yaqoob, I., Anuar, N.B., Mokhtar, S., Gani,
A., & Khan, S.A. (2015). The rise of “big data” on cloud
computing: review and open research issues. Inf Syst., 47, 98–115.
101184. doi:10.1016/j.cola.2022.101184
Alzubaidi, L., Zhang, J., Humaidi, A. J., Al-Dujaili, A., Duan, Y.,
Applications, 205-228.
Publishing Ltd.
859. doi:10.1016/j.cmet.2020.08.007
Bellogín, A., Cantador, I., Díez, F., Castells, P., & Chavarriaga, E.
doi:10.1145/2414425.2414439
Beri, R. (2019). Python Made Simple: Learn Python programming
Bharany, S., Sharma, S., Badotra, S., Khalaf, O. I., Alotaibi, Y.,
analytics. doi:10.1007/978-3-319-27057-9_10
algorithm with multi-hop routing via low degree relay nodes for
020-02385-1
Chen, L., Bentley, P., Mori, K., Misawa, K., Fujiwara, M., &
Chen, S., Zhang, L., Tang, Y., Shen, C., Kumar, R., Yu, K., Tariq,
doi:10.1016/j.scs.2020.102333
Chen, Z., Wang, Y., Zhao, B., Cheng, J., Zhao, X., & Duan, Z.
doi:10.1109/ACCESS.2020.3030076
Cho, K., Kim, K. D., Nam, Y., Jeong, J., Kim, J., Choi, C., Lee, S.,
Lee, J. S., Woo, S., Hong, G.-S., Seo, J. B., & Kim, N. (2023).
doi:10.1007/s10278-023-00782-4
data, 61-139.
Critien, J. V., Gatt, A., & Ellul, J. (2022). Bitcoin price change and
102409. doi:10.1016/j.adhoc.2020.102409
Academic Press.
using R: quantitative tools for data analysis and data science. John
Lisp, 75-99.
Duan, L., Xu, L., Guo, F., Lee, J., & Yan, B. (2007). A local-
doi:10.4324/9781003343097
Dutta, S., Chowdhury, A., Debnath, I., Sarkar, R., Dey, H., &
doi:10.15864/jmscm.1310
Eizirik, D. L., Pasquali, L., & Cnop, M. (2020). Pancreatic β-cells
doi:10.1038/s41574-020-0355-7
method for discovering density varied clusters. Int Sch Res Not.
Ester, M., Kriegel, H. P., Sander, J., & Xu, X. (1996). A density-
DBSCAN with Eps automatic for large dataset. Int J Adv Comput
Structures for Massive Data Sets. In SODA (Vol. 10, pp. 909-910).
doi:10.1090/dimacs/050/02
Hao, J., & Ho, T. K. (2019). Machine learning made easy: A review
doi:10.3102/1076998619832248
357–362.
Harris, C. R., Millman, K. J., Van Der Walt, S. J., Gommers, R.,
Virtanen, P., Cournapeau, D., Wieser, E., Taylor, J., Berg, S.,
Smith, N. J., Kern, R., Picus, M., Hoyer, S., van Kerkwijk, M. H.,
Brett, M., Haldane, A., del Río, J. F., Wiebe, M., Peterson, P., &
Publishing. doi:10.1007/978-3-319-28316-6
1146. doi:10.1109/TFUZZ.2012.2201485
doi:10.1007/s11704-013-3158-3
doi:10.1007/978-3-030-25943-3_34
https://www.javatpoint.com/
Johansson, R. (2019). 1. Scientific Computing and Data Science
Urayasu-shi.
Apress. doi:10.1007/978-1-4842-4246-9
J. P., Halford, J. L., Weng, L.-C., Nauffal, V., Roselli, C., Hall, A.
Bai, X., Balasubramanian, S., Baras, A., Beechert, C., Boutkov, B.,
doi:10.1038/s41588-021-01011-w
Apps, 41-54.
Khandare, A., Agarwal, N., Bodhankar, A., Kulkarni, A., & Mane,
2022, 157–177.
Khriji, S., Chéour, R., & Kanoun, O. (2022). Dynamic Voltage and
doi:10.3390/electronics11244071
Things, 141-159.
Kiran, S. V., Kaur, I., Thangaraj, K., Saveetha, V., Kingsy Grace,
Graphics.
Klarin, D., Lynch, J., Aragam, K., Chaffin, M., Assimes, T. L.,
Huang, J., Lee, K. M., Shao, Q., Huffman, J. E., Natarajan, P.,
Arya, S., Small, A., Sun, Y. V., Vujkovic, M., Freiberg, M. S.,
Wang, L., Chen, J., Saleheen, D., Lee, J. S., & Damrauer, S. M.
1279. doi:10.1038/s41591-019-0492-5
Klasen, V., Bogucka, E. P., Meng, L., & Krisp, J. M. (2023). How
doi:10.1080/23729333.2022.2156316
doi:10.1201/9781003139010-6
Kong, Q., Siauw, T., & Bayen, A. (2020). Python programming and
Press.
Lafuente, D., Cohen, B., Fiorini, G., García, A. A., Bringas, M.,
doi:10.1021/acs.jchemed.1c00142
100.
Networking Academy.
https://www.netacad.com/courses/programming/pcap-
programming-essentials-python
Li, Z., Li, H., Ralescu, A. L., Dillman, J. R., Parikh, N. A., & He,
Liang, H., Yang, S., Li, L., & Gao, J. (2019). Research on routing
Li, J., Chen, Q., Hu, X., Yuan, P., Cui, L., Tu, L., Cui, J., Huang, J.,
Jiang, T., Ma, X., Yao, X., Zhou, C., Lu, H., & Xu, J. (2021).
doi:10.1016/j.ijmedinf.2021.104429
Liu, P., Zhou, D., & Wu, N. (2007, June). VDBSCAN: varied
doi:10.1109/TSC.2009.11
doi:10.3115/1699510.1699544
Li, X., Zhang, Y., Leung, J., Sun, C., & Zhao, J. (2023).
Academic Press.
doi:10.1109/CIT.2008.4594646
92bf1922-00a
Media, Inc.
doi:10.1007/978-3-030-53829-3_20
doi:10.1109/MCSE.2011.36
Molin, S., & Jee, K. (2021). Hands-On Data Analysis with Pandas:
Moussaid, A., Zrira, N., Benmiloud, I., Farahat, Z., Karmoun, Y.,
MDPI.
Python:
https://www.digitalocean.com/community/tutorials/vectors-in-
python
doi:10.1007/978-981-19-7874-6_23
Springer. doi:10.1007/978-981-15-1884-3_22
doi:10.1142/S1793962322410069
Guide: https://numpy.org/doc/stable/user/whatisnumpy.html
doi:10.1109/MCSE.2007.58
https://www.freecodecamp.org/news/create-cryptocurrency-using-
python/
Educreation Publishing.
doi:10.1109/ACCESS.2020.2988358
doi:10.1109/COMM54429.2022.9817183
Ram, A., Jalal, S., & Kumar, M. (2013). A density based algorithm
Rather, M. A., Agarwal, D., Bhat, T. A., Khan, I. A., Zafar, I.,
doi:10.1016/j.ijbiomac.2023.123549
doi:10.1109/ICISC47916.2020.9171085
https://www.simplilearn.com/tutorials/blockchain-
tutorial/blockchain-technology
doi:10.1109/CoNTESA57046.2022.10011382
doi:10.1111/coin.12318
Sarwar, S., Sirhindi, R., Aslam, L., Mustafa, G., Yousaf, M. M., &
doi:10.1109/ACCESS.2020.3021016
doi:10.1007/978-3-030-49720-0
doi:10.1080/03772063.2023.2218317
357–366. doi:10.1016/j.procs.2023.01.018
doi:10.1145/1026487.1008112
doi:10.3390/app11167179
of free Python libraries for data mining and big data analysis. In
doi:10.23919/MIPRO.2019.8757088
Stefan van der Walt, S. C. (2021). The NumPy Array: A Structure
Streib, J. T., Soma, T., Streib, J. T., & Soma, T. (2017). Stacks and
Su, Y., Lu, X., Zhao, Y., Huang, L., & Du, X. (2019). Cooperative
doi:10.1016/j.comcom.2019.10.006
Springer. doi:10.1007/978-3-030-68952-0
496.
Wiener, R. (2022). Queues and Lists. In Generic Data Structures
1-4842-8191-8_6
Wu, X., Zhu, X., & Wu, G. Q. (2014). Data mining with big data.
97–107. doi:10.1109/TKDE.2013.109
Sliding Window with Circular Linked List for Dynamic Data Flow.
doi:10.1145/3424978.3425152
https://www.analyticsinsight.net/top-10-useful-python-packages-to-
pull-cryptocurrency-data-seamlessly/
Zeng, W., Shang, M. S., Zhang, Q. M., Lü, L., & Zhou, T. (2010).
doi:10.1007/978-3-642-40063-6_100
410. doi:10.1109/BigData.Congress.2013.60
Zhou, H. Y., Lu, C., Chen, C., Yang, S., & Yu, Y. (2023). A Unified
doi:10.1109/TPAMI.2023.3234002
About the Contributors
|MOHAMMAD GALETY - Editor|Mohammad Gouse Galety received his
patents, and five books. Since 1999, he has served in different national and
the IEEE. As of 2020, Google Scholar reports over 250 citations to his
work.e502d01f-6393-42c4-8526-9d8a33b2bb9b
has chaired many technical sessions and delivered more than 15 invited
a87d-488f-882e-c486da9905f7
and Education for about 25+ years. Have 7 years of industrial experience on
strategic servers and 19 years of teaching and research. Around 40+ articles
international repute where some of them are indexed in Scopus and ESCI.
applications, web service frameworks, and cyber security solutions are the
regular track of his occupation while building research models adaptable for
industry and academia. His academic profile fairs with funded projects and
seminar grants from AICTE, ISRO, etc.. He has 3 (three) patents filed, 1
credits.160b6754-0ced-4621-9013-07fa4118aaf1
* * *
Coimbatore.05401693-0e93-4b08-94f9-878f99796ad5
de4e83218624
057895edd4d8
big data, image processing, and data science. He has written more than four
journal papers.b8a944a9-579a-4a5c-8b85-dd9ef6728b9b
4e3b-a695-137c30599fd3
Security. She has completed nine certifications in the field of Statistics and
Data Science from different IITs and from other institutions. She also works
company, AXEL.789f5444-6334-4814-8b44-4ac27541623f
13 patents and 6 books published to her credit. She has published around 70
reviewer for several journals; and has served on the program committees
and co-chaired for various international conferences.81bfef00-ef2d-4b46-
b07c-904dc1dd98f7
7d8113d2765c
c21438cd94c8
2011. His research interests span both computer networking and software
engineering and quality assurance. Much of his work has been on improving
983e3382f5df
MCA degree from Bharathiyar University and the BSC degree in Computer
Science from Bharathiyar University and also received the Ph.D. degree in
proceedings .Moreover, she has published 3 books, few book chapters and 1
patent under a reputed publishers. Her research interests include the cloud
8ba2c50e05a9
3584674d0559
1fc4204dbc2b
475a51e88e04
fca913ed9b71
journals and conferences. His area of interest is not limited to Data Science,
Software Engineering.67674f66-a42b-40e9-bbb2-7b468eeb631c
|A.V. Sriharsha - Contributing Author|9457aed5-c4f0-4d13-bb2b-
bb8d71fc4b25
d3fface024a6
4d3eaaf29cd3
8731ca2dc25b