Class Intermediate Data Science
Class Intermediate Data Science
Source:Various available source including web, Also, acknowledge several resources and references for many of the slides from different academic means
Sense of data and information in nature /survival
Another data form
Montreal protocol
The Montreal Protocol is an international treaty that came into existence to protect the
ozone layer.
It puts emphasis to phase out the production of numerous substances that are responsible
for ozone depletion.
This protocol was agreed upon on 16 September 1987, and came into force in January
1989. Following this it underwent, nine revisions, across different places, namely London,
Nairobi, Copenhagen, Bangkok, Vienna, Montreal, Australia, Beijing and Kigali.
As a result of the international agreement, it is found that the ozone hole in Antarctica is
slowly recovering*
*Ref: "Ozone Layer on Track to Recovery: Success Story Should Encourage Action on Climate". UNEP. UNEP. 10 September 2014.
Tragedy of Commons
The tragedy of the commons is a situation in which members or individual users, who have free access to a resource which
is shared in society without any well defined set of rules for governing the access and use, act independently according to
their self interest and, not in accordance with the common good of all other users, results in depletion of the resource due to
their uncoordinated action [Lloyd].
"Commons" may refer to an unregulated resource with open-access, such as the atmosphere, oceans, rivers, ocean fish
stocks
Insights/unders
Data Information tanding/policy
making
Data science
Data science is a multidisciplinary approach
to extracting actionable insights from the large
Computing/ and ever-increasing volumes of data collected
Machine Data Maths/Statis
learning Scie tics
and created by today’s organizations.
nce
Data science encompasses preparing data for
Domain analysis and processing, performing advanced
Knowledge/R
elevance data analysis, and presenting the results to
reveal patterns and enable stakeholders to
draw informed conclusions.
Fig. inspired by Drew Conway’s venn Diagram, Ref: What is Data Science | IBM
Python has emerged during the last few decades as an excellent tool for scientific and computing tasks.
The efficacy of Python for data science originates primarily from the vast and active ecosystem of third-party packages:
2 # Include the bash command regardless of whether or not you are using the Bash shell
bash ~/Downloads/Anaconda3-2020.05-MacOSX-x86_64.sh
# Replace the .sh file name with the name of the file you downloaded or
# Include the bash command regardless of whether or not you are using the Bash shell
bash ~/Downloads/Anaconda2-2019.10-MacOSX-x86_64.sh
# Replace the .sh file name with the name of the file you downloaded
❏ Press Enter to review the license agreement. Then press and hold
Enter to scroll.
❏ Enter “yes” to agree to the license agreement.
❏ Use Enter to accept the default install location
❏ Installation may take a few minutes to complete.
❏ The installer prompts you to choose whether to initialize Anaconda
Distribution by running conda init. recommend entering “yes”.
Launching the Jupyter Notebook
For executing Python/IPython statements, the notebook allows the user to include formatted text, static and dynamic
visualizations, mathematical equations, etc
Though the IPython notebook is viewed and edited through your web browser window, it must connect to a running
Python process in order to execute code. This process (known as a "kernel") can be started by running the following
command in your system shell:
$ jupyter notebook
This command will launch a local web server that will be visible to your browser. It immediately spits out a log
showing what it is doing; that log will look something like this:
$ jupyter notebook
[NotebookApp] Serving notebooks from local directory: /Users/Downloads/Socialcomquant
[NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
Upon issuing the command, your default browser should automatically open and navigate to the listed local URL;
the exact address will depend on your system. If the browser does not open automatically, you can open a window
and manually open this address (http://localhost:8888/ in this example).
Introduction to python programming
An operating system, or OS, is a “special” program on the computer that has direct access
to the hardwares
Python expressions
If we open python terminal the >>> part is called a prompt, because it prompts us to type
something
Python commands are called statements and are simply known as expression statement or
‘expression’
String can store characters from the Latin alphabet found on most North American
keyboards.
Another data type called unicode can store strings containing any characters at all,
including Chinese ideograms, and chemical symbols.
x=”yourfirstname”
y=”yourlastname”
x+y or print(x)
List and its modification
my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
nobles[1] = 'neon'
nobles
“currency”
Courtesy:JC
Note: Definition and Usage. The range () function returns a sequence of numbers, starting
from 0 by default, and increments by 1 (by default), and stops before a specified number.
17x+22y=500
B = np.array([350, 500])
X = np.linalg.solve(A,B)
#X = np.linalg.inv(A).dot(B)
print(X)
Illustration
Product of matrices
Python output of product matrices
Squaring/Powering
Demo, Hands on with Codes
Introducing matplotlib and pandas with applications:
“Network” ≡ “Graph”
node points lines Domain
1
Types of networks
There are several classifications of networks:
❑ According to direction of links: directed or undirected
❑ According to kind of interaction: weighted or unweighted
❑ According to differences between nodes: bipartite or not
Directed and undirected
networks
• The relationship between nodes may be symmetric (undirected
networks) or asymmetric (directed networks).
Again, the weight of the links is crucial in dynamical processes occurring in the network,
such as information spreading, synchronization or network robustness.
Bipartite networks
• Networks with two (or more) kind of nodes and links joining
ONLY nodes of unlike type.
• For example, we may have individuals and events
• directors and boards of directors network; movies and actors network;
affiliation and students network; customers and the items they purchase
❑ Despite the different types of networks, which in turn are obtained
from completely different interacting systems (people, neurons,
proteins, routers,...) we will see that they share some universal
properties
Examples:Network Everywhere