Introduction To Data Science
Introduction To Data Science
Introduction To Data Science
Learning Outcomes
1. Understand data science concept
2. Explain Data Types and Control Flow in Python
OUTLINES:
Structured : Any data set that adheres to a specific structure can be called structured data.
Semi-structured data: This type of data does not adhere to a specific structure yet retains some kind of
observable structure such as a grouping or an organized hierarchy.
Unstructured data. This type of data consists of data that does not adhere to a schema or a preset
structure.
What to do with all
data?
derive meaningful insights (e.g: understanding human behavior) which in turn helps
businesses to understand their customers better.
Too
ls
▪ Data Science: Problems that hard for human – but easy for computer.
▪ Artificial Intelligence (AI): Problems that hard for computer– but easy for human.
Techno, Tools, & Programming languages for Data Science
Programming
Languages
Capability: coding, testing, and running your code from one tool, highlighting your
syntax, bracket-matching, auto-completing your code, debugging, code suggestions
and a lot more
Cloud-based Jupyter Notebook
https://colab.research.google.com/
Desktop GUI
https://www.anaconda.com/products/distribution
Desktop: https://www.rstudio.com/products/rstudio/download/
Cloud🡪 https://rstudio.cloud/
Scala (Scalable Language) is programming language
for Big data
Scala and Spark are being used at Facebook, Pinterest, NetFlix, Conviva,
TripAdvisor for Big Data and Machine Learning applications.
https://www.tableau.com/products/desktop/download
Desktop: https://powerbi.microsoft.com/en-us/desktop/
Mobile: https://powerbi.microsoft.com/en-us/mobile/
Service
Basic Python for Data Science
WHY
Why Python
PYTHON?
Demo dilakukan di Google Colab/Anaconda
Jupyter Notebook
Syntax
▪ Indentation refers to the spaces at the beginning of a code line.
▪ Python uses indentation to indicate a block of code.
▪ The Number of spaces is up to you as a programmer, the most common use is four, but it
has to be at least one.
▪ use the same number of spaces in the same block of code, otherwise Python will give you an
error
Comments
Usage:
to explain Python code; to make the code more readable; to prevent execution when testing
code.
Starts with a #, and Python will ignore them.
Multiline String
Variable
▪ Variable is containers for storing data values.
▪ A variable is created the moment you first assign a value to it.
▪ Rules for Python variables:
a. A variable name must start with a letter or the underscore character
b. A variable name cannot start with a number
c. A variable name can only contain alpha-numeric characters and underscores
(A-z, 0-9, and _ )
d. Variable names are case-sensitive (age, Age and AGE are three different
variables)
Variable
VARIABLE ASSIGNMENT
1. The assignment operator, denoted by the “=“ symbol, is the operator that is used to
assign values to variables in Python.
2. The line height=1.79 takes the known value, 1.79, and assigns that value to the variable
with name “height”.
3. After executing this line, this number will be stored into this variable
VARIABLE ASSIGNMENT
• Evaluate the expressions in the RHS(Right Hand Side) and assign them to the
variables on the LHS
Simultaneous Assignment
1. int (signed integers): integers or ints, are positive or negative whole numbers with no decimal point.
2. long (long integers ): integers of unlimited size, written like integers and followed by an uppercase or
lowercase L.
3. float (floating point real values) : or floats, represent real numbers and are written with a decimal point
dividing the integer and fractional parts. Floats may also be in scientific notation
4. complex (complex numbers) : are of the form a + bJ, where a and b are floats and J (or j) represents
the square root of -1 (which is an imaginary number). a is the real part of the number, and b is the
imaginary part.
Numbers Operation
• Type int(x)to convert x to a plain integer.
• Type long(x) to convert x to a long integer.
• Type float(x) to convert x to a floating-point number.
• Type complex(x) to convert x to a complex number with real part x and imaginary part zero.
• Type complex(x, y) to convert x and y to a complex number with real part x and imaginary part y.
x and y are numeric expressions
Python does not support a character type; these are treated as strings of length one, thus also considered a
substring. To access substrings, use the square brackets for slicing along with the index or indices to obtain
your substring:
Example:
var 1 = 'Hello World!' This will produce following result:
var2 = "Python Programming" var1[0]: H
print "var1[0]: ", var1[0] var2[1:5]: ytho
print "var2[1:5]: ", var2[1:5]
String
You can "update" an existing string by (re)assigning a variable to another string. The new
value can be related to its previous value or to a completely different string altogether.
Example:
var1 = 'Hello World!'
print "Updated String :- ", var1[:6] + 'Python'
Assume string variable a holds 'Hello' and variable b holds 'Python' then we can use
the String Special Operators
Special Operators
Formatting Operator:
LIST
A List is a Kind of Collection
A collection allows us to put many values in a single “variable”
A collection is nice because we can carry all many values
around in one convenient package.
http://docs.python.org/tutorial/datastructures.html
Best Friends: Lists and Definite Loops Split breaks a string into
parts and produces a list of
>>> abc = 'With three words' >>> print(stuff) strings. We think of these
>>> stuff = abc.split() ['With', 'three', 'words'] as words.
>>> print(stuff) >>> for w in stuff :
['With', 'three', 'words'] ... print(w) We can access a particular
>>> print(len(stuff)) ... word or loop through all the
3 With words.
>>> print(stuff[0]) Three
With Words
>>>
Best Friends: Strings and Lists
Happy New Year: Joseph
friends = ['Joseph', 'Glenn', 'Sally'] z = ['Joseph', 'Glenn', 'Sally'] Happy New Year: Glenn
for friend in friends : for x in z: Happy New Year: Sally
print('Happy New Year:', friend) print('Happy New Year:', x)
print('Done!') print('Done!') Done!
List Manipulation:
Tuple
• Written with round brackets.
• Tuple items are ordered, unchangeable, and allow duplicate values.
tuple1 = ("apple", "banana", "cherry")
tuple2 = (1, 5, 7, 9, 3)
tuple3 = (True, False, False)
Can be of any data types
• for loop
• while loop
For LOOP
used to iterate over a sequence that is either a list, tuple, dictionary, or a set. We can execute
a set of statements once for each item in a list, tuple, or dictionary.
While LOOP
used to execute a block of statements repeatedly until a given condition is satisfied. Then,
the expression is checked again and, if it is still true, the body is executed again. This
continues until the expression becomes false.
References:
https://www.educative.io/answers/what-are-control-flow-statements-in-python
https://www.w3schools.com/python/
Welcome Binusian 2026
Berikut informasi penting untuk mengikuti kegiatan Academic
Expericence (AE):
• Untuk melihat jadwal pelaksanaan AE Sync (ViCon), silahkan akses
https://newbinusmaya.binus.ac.id/
• Untuk mengakses evaluasi FYP Courses AE, silahkan akses
https://cx.apps.binus.ac.id/