0% found this document useful (0 votes)
14 views

Introduction to data science practical1

The document introduces data science and emphasizes the advantages of Python as a programming language, particularly for beginners due to its simple syntax. It highlights Python's versatility across various applications such as web development, data analysis, and AI/ML, while also noting some drawbacks of using Python as a first language compared to statically typed languages like Java. The document includes practical examples of using Python for data manipulation and statistical calculations.

Uploaded by

baderahed21
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Introduction to data science practical1

The document introduces data science and emphasizes the advantages of Python as a programming language, particularly for beginners due to its simple syntax. It highlights Python's versatility across various applications such as web development, data analysis, and AI/ML, while also noting some drawbacks of using Python as a first language compared to statically typed languages like Java. The document includes practical examples of using Python for data manipulation and statistical calculations.

Uploaded by

baderahed21
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Introduction to data science

Dr. Khaled Almghari


Practical lecture
Lecture #1 practical
Why do we choose Python?
• Python is recommended for beginners
because of its straightforward syntax, similar
to everyday English. This makes it easier for
novices to learn and understand basic
programming concepts without getting
overwhelmed by complex syntax rules,
fostering a smoother learning curve.
Lecture #1 practical
Why is Python better than other languages?
• Python is good for all forms of programming,
which makes its user base grow rapidly.
Cross-platform shell scripting, quick
automation, simple web development, data
analysis and visualization, AI and ML are
some of the examples. Often, specialists use
Python to better perform a variety of tasks in
different disciplines.
Lecture #1 practical
• Why should Python not be your first language?
• While Python is the most hot topic these days, either in web
development (not that much), data science, or AI/ML,. Python provides
rich libraries for such applications and is kind of cool. There are certain
aspects where Python may not be the best choice as a first language
when compared to Java or C++.I have discussed 10 points regarding that.
• Data Type Declarations: Variables can be declared without specifying
their data type in Python. Dynamic typing offers flexibility and
convenience, but it can sometimes lead to challenges related to
understanding data types and their limitations. Dynamically typed
languages provide less type safety compared to statically typed
languages like Java. In Python, you can assign values of different types to
the same variable without explicit declarations or checks. In Python,
variable x need not be defined explicitly but in a language like Java or C+
+.
Lecture #1 practical
• import numpy as np
• import pandas as pd
• import statistics
• x = [3,
16, 5, 3]11, 154, 1, 5, 9, 220,
• x.sort()
• print("Sorted of x:",x)
• print("Mean
=",statistics.mean(x))
• print("Sample variance
=",statistics.variance(x))
• print("Sample
deviation standard
=",statistics.stdev(x))
• y=statistics.variance(x)*9
• print("y =",y)
• pop=y/10
• print("population
=",pop) variance
Thanks for your attention

You might also like