You are on page 1of 11

QUESTION 1

In this report, we explore the field of Data Science and its significance in today's data-driven
QUESTION 1
In this report, we explore the field of Data Science and its significance in today's data-driven
world. We begin by defining Data Science and providing an overview of the Python libraries
commonly used in this field. Furthermore, we present ten real-world applications of Data
Science and delve into two specific applications to showcase the impact and potential of this
rapidly growing field.

a. Introduction to Data Science and Python Libraries:


Data Science:
Data Science is an interdisciplinary field that combines various techniques, methods, and
tools to extract meaningful insights, patterns, and knowledge from large and complex
datasets. It encompasses elements of statistics, mathematics, computer science, and domain
expertise to uncover hidden trends and make informed decisions. Data Science plays a crucial
role in extracting actionable information from vast amounts of data, enabling organizations to
optimize processes, develop predictive models, and drive innovation.

Python Libraries for Data Science:


Python, with its extensive ecosystem of libraries, has emerged as a leading programming
language for Data Science. The following Python libraries are widely used in the Data
Science domain:

1. NumPy - Numerical Python: Provides powerful mathematical functions and tools for
working with arrays and matrices.
2. Pandas: Offers data manipulation and analysis capabilities, including data cleaning,
transformation, and exploration, using powerful data structures such as Data Frames.
3. Matplotlib: A versatile plotting library for creating a wide range of static, animated, and
interactive visualizations.
4. Seaborn: Built on top of Matplotlib, Seaborn provides a higher-level interface for creating
statistical visualizations with less code.
5. Scikit-learn: Offers a comprehensive set of machine learning algorithms and tools for
tasks such as classification, regression, clustering, and dimensionality reduction.
6. TensorFlow: A popular library for implementing and deploying deep learning models,
enabling efficient computation on large-scale neural networks.
7. Keras: A high-level deep learning API that runs on top of TensorFlow, simplifying the
process of building and training neural networks.
8. PyTorc: Another powerful deep learning library that provides dynamic computation graphs
and advanced functionality for building and training neural networks.

9. Natural Language Toolkit (NLTK): A library for working with human language data,
offering various tools and resources for tasks such as tokenization, stemming, tagging, and
parsing.
10. OpenCV: A computer vision library that provides a wide range of functions and
algorithms for image and video processing, object detection, and recognition.

b. Ten Real-world Applications of Data Science:

1. Fraud Detection: Data Science enables the identification of fraudulent activities by


analysing patterns and anomalies in transaction data, helping financial institutions and e-
commerce platforms protect against fraudulent behaviour.
2. Customer Churn Prediction: By analysing customer behaviour and historical data, Data
Science can predict which customers are likely to churn, enabling businesses to proactively
take measures to retain them.
3. Demand Forecasting: Data Science models can forecast demand for products or services,
helping businesses optimize inventory management, production planning, and supply chain
operations.
4. Sentiment Analysis: By employing natural language processing techniques, Data Science
can analyse text data from social media, customer reviews, and surveys to determine
sentiment and identify trends, providing valuable insights for businesses.
5. Healthcare Analytics: Data Science plays a critical role in healthcare, from analysing
patient data to improving diagnostics, predicting disease outbreaks, and optimizing treatment
plans.
6. Recommendation Systems: Data Science techniques power recommendation systems in
e-commerce, media streaming platforms, and social networks, providing personalized
suggestions based on user behaviour and preferences.
7. Predictive Maintenance: By analysing sensor data and historical, Data Science models
can predict equipment failures and maintenance requirements, helping reduce downtime and
improve efficiency in manufacturing and industrial settings.

Image Recognition: Data Science enables image recognition and object detection in fields
such as autonomous vehicles, surveillance systems, and medical imaging, aiding in diagnosis
and decision-making.

Energy Consumption Optimization: Data Science can analyse energy usage patterns to
identify inefficiencies, optimize energy consumption, and develop strategies for sustainable
energy management.

Transportation Optimization: Data Science techniques can analyse transportation data,


including traffic patterns, public transportation routes, and logistics, to optimize
transportation systems, reduce congestion, and improve efficiency.

c. Detailed Discussion of Two Applications:

1. Fraud Detection:
Fraud is a significant concern for financial institutions and e-commerce platforms. Data
Science plays a crucial role in detecting and preventing fraudulent activities by analysing
large volumes of transactional data. Machine learning algorithms can identify patterns,
anomalies, and suspicious behaviour in real-time, enabling organizations to take immediate
action. Features such as transaction amount, location, time, and customer behaviour can be
used to build predictive models that flag potentially fraudulent transactions. By leveraging
Data Science techniques, organizations can reduce financial losses, protect customers, and
maintain trust in their platforms.

2. Healthcare Analytics:
Data Science has transformed the healthcare industry by enabling advanced analytics on vast
amounts of patient data. Machine learning algorithms can analyse electronic health records
(EHRs), medical imaging data, and genetic information to identify patterns and make
predictions. This aids in disease diagnosis, treatment planning, drug discovery, and clinical
decision-making. Data Science also plays a critical role in public health by analysing
population-level data to detect disease outbreaks, predict the spread of infectious diseases,
and allocate resources efficiently. By leveraging the power of Data Science, healthcare
providers can improve patient outcomes, personalize treatments, and enhance overall
healthcare delivery.
QUESTION 2

a. Algorithm Design:
1. Create a class called Account.
2. Initialize the account balance to 0 in the class constructor.
3. Implement the Deposit() method to take an amount as input and add it to the account
balance.
4. Implement the Withdraw() method to take an amount as input and subtract it from the
account balance.
5. Implement the Balance() method to return the current account balance.

b. Implementation in Python
class BankAccount:
def __init__(self):
self.balance = 0

def deposit(self, amount):


if amount > 0:
self.balance += amount
print(f"Deposited ${amount}. Current balance: ${self.balance}")
else:
print("Invalid amount. Deposit amount should be positive.")

def withdraw(self, amount):


if amount > 0:
if self.balance >= amount:
self.balance -= amount
print(f"Withdrawn ${amount}. Current balance: ${self.balance}")
else:
print("Insufficient funds.")
else:
print("Invalid amount. Withdrawal amount should be positive.")

def balance_check(self):
print(f"Current balance: ${self.balance}")

account = BankAccount()
account.balance_check() # Current balance: $0

account.deposit(1000)
account.balance_check()

account.withdraw(500)
account.balance_check()

account.withdraw(1000)
account.deposit(-200)

c. Discussion of Results:
The program defines a class called Account to simulate banking operations. The `deposit`
method allows the user to add money to their account, the `withdraw` method allows them to
withdraw money if they have sufficient balance, and the `balance` method returns the current
account balance.
When the program is executed, it creates an instance of the Account class. Initially, the
balance is 0. It then performs some operations, such as depositing 1000 units, withdrawing
500 units (which is successful), and attempting to withdraw 700 units (which fails due to
insufficient balance).
The program prints the current balance after each operation. This helps to verify that the
operations are executed correctly and the balance is updated accordingly.

The output of the program should be:


Initial balance: 0
Deposit successful.
Current balance: 1000
Withdrawal successful.
Current balance: 500
Insufficient balance or invalid amount for withdrawal.
Current balance: 500
This program provides a basic implementation of a banking simulation using a class in
Python. It can be further expanded by adding more features such as transaction history,
interest calculations, and account holder information.
QUESTION 3
3.1
Code:
list1 = [10, 20, 30, 40]
list2 = ["Ram", 19, 87.81]
combined_dict = dict(zip(list1, list2))
print(combined_dict)

Output:
{10: 'Ram', 20: 19, 30: 87.81}

3.2
Code:
number = int(input("Enter a number: "))
while number >= 0:
print(number)
number -= 1

Output:
Enter a number: 5
5
4
3
2
1
0
ACKNOWLEDGMENT:

I would like to express my special thanks of gratitude to my Professor, who


gave me the golden opportunity to do this wonderful Assignment on various
aspects of Computer Science and it’s real life applications and problem solving
on other aspects of the subject. I came to know about so many new things I am
really thankful to them!

You might also like