Data science report
Data science report
DATA SCIENCE
is submitted in partial fulfillment of the requirement (III B.Tech Summer
Break) for the award of the Degree of Bachelor of Technology
to
2022-2023
Department of Electronics and Communication Engineering
CERTIFICATE
1.
2.
DECLARATION
I hereby declare that the internship entitled DATA SCIENCE has been done by
me and has submitted to NARAYANA ENGINEERING COLLEGE, NELLORE as a
part of partial fulfillment of the requirements for the award of degree of Bachelor of
Technology in Department of Electronics and Communication Engineering.
I also declare that this internship report has not submitted to any other institute or
university and not copied from any other sources.
SK. RESHMA
(19711A04A3)
Place: NELLORE
Date:
ACKNOWLEDGEMENT
I would like to thank my Head of the Department Dr. K. Murali M.Tech, Ph.D,
Professor & HOD, Department of Electronics and Communication Engineering,
Narayana Engineering College, Nellore for his constructive criticism throughout my
internship.
I would like to thank Dr. K. S. Sagar Reddy M.Tech, Ph.D, Professor, Internship
Coordinator, Department of ECE for their support and advices to get his guidance,
constant assistance, support, endurance and constructive for the betterment of the
internship.
I would like to thank the CEO of SKILLDZIRE for giving me the opportunity to
do an internship within the organization through virtual mode. I also would like all the
people that worked along with me in SKILLDZIRE, HYDERABAD with their patience
and openness they created an enjoyable working environment. It is indeed with a great
sense of pleasure and immense sense of gratitude that I acknowledge the help of these
individuals.
SHAIK RESHMA
(19711A04A3)
INDEX
NAME PAGE NO
Figure 1.2.1: Steps of Data Science 2
Figure 1.4.1: Role of Data Science 4
Figure 2.2.1: Array example 6
Figure 2.2.2: List example 7
Figure 2.2.3: Tuple example 7
Figure 2.2.4: Dictionary example 8
Figure 2.2.5: A data structure tree at glance 8
Figure 2.4.1: If else statement 11
Figure 2.4.2: Elif example 11
Figure 2.5.1: Range example 13
Figure 2.5.2: While loop example 13
Figure 2.6.1: Packages example 14
Figure 2.6.2: Function example 15
Figure 4.1.1: Matplotlib basic example 23
Figure 4.2.1: Pandas basic example 24
Figure 4.3.1: NumPy basic example 25
List of Tables
Name Page No
Table 2.3.1: Arithmetic operators 9
Table 2.3.2: Assignment operators 9
Table 2.3.3: Logical operators 10
Table 2.3.4: Comparison operators 10
Table 2.3.5: Membership operators 11
ABSTRACT
Data science encompasses a set of principles, problem definitions,
algorithms, and processes for extracting nonobvious and useful patterns from large data
sets. Many of the elements of data science have been developed in related fields such as
machine learning and data mining. In fact, the terms data science, machine learning, and
data mining are often used interchangeably. The commonality across these disciplines is
a focus on improving decision making through the analysis of data. However, although
data science borrows from these other fields, it is broader in scope. Machine learning
(ML) focuses on the design and evaluation of algorithms for extracting patterns from data.
Data mining generally deals with the analysis of structured data and often implies an
emphasis on commercial applications. Data science takes all of these considerations into
account but also takes up other challenges, such as the capturing, cleaning, and
transforming of unstructured social media and web data; the use of big-data technologies
to store and process big, unstructured data sets; and questions related to data ethics and
regulation.
Organization Information / Industry Profile
Each company has its own protocols and principles where every intern should follow that
to attend the classes regularly and also should be an active participant by the assigned
task like assignments and should submit a project at the end to get a certificate as the
proof that the particular candidate has worked as a intern under our organization
successfully. The benefit for the undergraduate students is to gain the practical experience
from the industry as by working under a project. Working as an intern doesn’t .This whole
Internship Experience helps to excel in a Software company on future.
Learning Objectives / Internship Objectives
Internships are generally thought of to be reserved for college students looking
to gain experience in a particular field. However, a wide array of people can
benefit from Training Internships in order to receive real world experience and
develop their skills.
An objective for this position should emphasize the skills you already possess in
the area and your interest in learning more
Below in the figure shows the role of Data Science and Big Data Analytics in the
Renewable Energy Sector.
Below is the figure shows how elif statement is used with description inside it.
The examples above are classes and objects in their simplest form, and are not
really useful in real life applications. To understand the meaning of classes we have to
understand the built-in __init__() function. All classes have a function called __init__(),
which is always executed when the class is being initiated. Use the __init__() function
to assign values to object properties, or other operations that are necessary to do when
the object is being created:
Example
Create a class named Person,use the __init__() function to assign values for name and
age:
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
p1 = Person("John", 36)
print(p1.name)
print(p1.age)
The__str__() Function
The __str__() function controls what should be returned when the class object is
represented as a string.If the __str__() function is not set, the string representation of the
object is returned:
Example:class Person:
def __init__(self, name, age):
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def __str__(self):
return f"{self.name}({self.age})"
p1 = Person("John", 36)
print(p1)
Some suspicious code that may raise an exception, you can defend your program
by placing the suspicious code in a try: block. After the try: block, include
an except: statement, followed by a block of code which handles the problem as elegantly
as possible.
Syntax
try:
You do your operations here;
except ExceptionI:
If there is ExceptionI, then execute this block.
except ExceptionII:
If there is ExceptionII, then execute this block.
Else:
You can also provide a generic except clause, which handles any exception.
After the except clause(s), you can include an else-clause. The code in the else-
block executes if the code in the try: block does not raise an exception.
The else-block is a good place for code that does not need the try: block's
protection.
File handling is an important part of any web application. Python has several
functions for creating, reading, updating, and deleting files.
The key function for working with files in Python is the open() function.
The open() function takes two parameters; filename, and mode.
"r" - Read - Default value. Opens a file for reading, error if the file does not exist
"a" - Append - Opens a file for appending, creates the file if it does not exist
"w" - Write - Opens a file for writing, creates the file if it does not exist
"x" - Create - Creates the specified file, returns an error if the file exists
"t" - Text - Default value. Text mode
"b" - Binary - Binary mode
Syntax
To open a file for reading it is enough to specify the name of the file:
f = open("demofile.txt")
f = open("demofile.txt", "rt")
Regular Expressions
RE is defined as set of symbols that are used to extract some set of strings based on
specified pattern.
Ex:-display all the python files in our computer whose extension is *.py
Such a pattern is used to locate a chunk of text in string by matching up the pattern
Ex:-Email,Ph no etc..
3.5 Functions
Search():-It searches for first occurence if re pattern within string with optional flags
sub():-Replaces on or many matches with a string
Split():-Returns a list where the string has been split at each match
Symbolic characters
^ :-Matches the start of the string
$ :-Matches the end of the String
. :-Matches any character except new line
() :-Matches sub-pattern inside parenthesis as a grp and stores in a substring
* :-Matches zero or more occurences of preceding sub-pattern
+ :-Matches one or more occurences of preceding sub-pattern
? :-Matches zero or one occurences of preceding sub-pattern
*? :-Matches zero or more occurences of preceding sub-pattern
{m,n} :- Matches from m repetition to occurences of the preceding sub pattern
:-Matches either of the sub-pattern present on either side of this special character
[] :-Matches any one of the character in the sequence.
4.3 NumPy
”NumPy is a library for the Python programming language, adding support for
large, multidimensional arrays and matrices, along with a large collection of high-level
mathematical functions to operate on these arrays”. The previous similar programming of
NumPy is Numeric, and this language was originally created by Jim Hugunin with
contributions from several other developers. In 2005, Travis Oliphant created NumPy by
incorporating features of the competing Numarray into Numeric, with extensive
modifications. It is an open source library and free of cost.
Example
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
print(arr)
print(type(arr))
To create an ndarray, we can pass a list, tuple or any array-like object into
the array() method, and it will be converted into an ndarray:
Example
Use a tuple to create a NumPy array:
import numpy as np
arr = np.array((1, 2, 3, 4, 5))
Array indexing is the same as accessing an array element. You can access an array
element by referring to its index number.
The indexes in NumPy arrays start with 0, meaning that the first element has
index 0, and the second has index 1 etc.
Example
Get the first element from the following array:
import numpy as np
arr = np.array([1, 2, 3, 4])
print(arr[0])
Example
Get the second element from the following array:
import numpy as np
arr = np.array([1, 2, 3, 4])
print(arr[1])
Example
Get third and fourth elements from the following array and add them.
import numpy as np
arr = np.array([1, 2, 3, 4])
print(arr[2] + arr[3])
Pandas DataFrame
Example
Create a simple Pandas DataFrame:
import pandas as pd
Dept. of ECE Narayana Engineering College, Nellore 26
data = { "calories": [420, 380, 390], "duration": [50, 40, 45]}
#load data into a DataFrame object:
df = pd.DataFrame(data)
print(df)
Result
calories duration
0 420 50
1 380 40
2 390 45