Unit 2
Unit 2
A shell is a type of computer program called a command-line interpreter that lets Linux and Unix
users control their operating systems with command-line interfaces.
Some of the essential basic shell commands in Linux for different operations are:
● File Management -> cp, mv, rm, mkdir
● Navigation -> cd, pwd, ls
● Text Processing -> cat, grep, sort, head
● System Monitoring -> top, ps, df
● Permissions and Ownership -> chmod, chown, chgrp
● Networking – > ping, wget, curl, ssh, scp, ftp
● Compression and Archiving – > tar, gzip, gunzip, zip, unzip
● Package Management – > dnf, yum, apt-get
● Process Management -> kill, killall, bg, killall, kill
The Python shell, also known as the Python interactive interpreter or REPL (Read-Eval-Print
Loop), is a command-line interface that allows you to interact directly with the Python
interpreter, execute code, and see the results immediately.
Jupyter Notebook
Jupyter notebooks are used for all sorts of data science tasks such as exploratory data analysis
(EDA), data cleaning and transformation, data visualization, statistical modeling, machine
learning, and deep learning.
IPython
IPython is an enhanced interactive Python shell that is used inside Jupyter Notebooks. It
provides additional functionality over the standard Python shell.
Magic Commands
Magic commands in IPython start with % (for single-line commands) or %% (for cell-wide
commands).
Link : https://jakevdp.github.io/PythonDataScienceHandbook/01.03-magic-commands.html
NumPy Universal functions (ufuncs in short) are simple mathematical functions that operate
on ndarray (N-dimensional array) in an element-wise fashion.
ufunc, or universal functions offer various advantages in NumPy. Some benefits of using ufuncs
are:
1. Vectorized Operations
Vectorization, in various contexts, refers to transforming data (like text or images) into
numerical vectors, allowing machines to perform mathematical computations on them
efficiently, or converting raster graphics into vector graphics.
ufuncs are more efficient than loops as they are applied simultaneously to all
elements. Vectorization is very useful on large data sets.
2. Type Casting
Type casting means converting the data type of a variable to perform the necessary operation.
ufuncs automatically handle type casting and ensure compatible datatypes for calculations.
3. Broadcasting
ufuncs automatically handle broadcasting and avoids the need for manual array shape
manipulation.
Function Description
Statistical functions
print(result) # Output: [2 4 6]
🔹 Why it works? The scalar 2 is "broadcast" to match the shape of arr.
print(result)
Output:
lua
CopyEdit
[[11 21 31]
[12 22 32]
[13 23 33]]
🔹 Why it works?
https://jakevdp.github.io/PythonDataScienceHandbook/