0% found this document useful (0 votes)
5 views52 pages

Python Programming Basics and Libraries

Uploaded by

jshs251120
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views52 pages

Python Programming Basics and Libraries

Uploaded by

jshs251120
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Introduction to

Artificial Intelligence & Robotics


03. Python Library
[Link]

Ukcheol Shin
Robot Physical AI Lab., KENTECH

Robust Physical AI School of Energy


& Robotics Lab. Engineering
Lecture’s agenda
[Python Library]
• [Recap] Important thing is a logical thinking!
• Python Library
• Matplotlib
• Word Cloud
• Numpy
• OpenCV

Robust Physical AI School of Energy


3
& Robotics Lab. Engineering
What is Programming?

New idea! Design algorithm Write a source code Test program

Programming
“the process of designing, writing, testing, and maintaining
a sequence of instructions (a program) to solve a problem.”

Robust Physical AI School of Energy


4
& Robotics Lab. Engineering
Important thing is logical thinking!

Write a source code

New idea! Design algorithm

Different syntax
Robust Physical AI School of Energy
5
& Robotics Lab. Engineering
Important thing is logical thinking!
# basic syntax of window CMD
# 1. standard I/O (input, print)
echo Hello, window CMD!
>> Hello, window CMD!

set /p name=Enter your name:


echo %var%

# 2. set variable
set var=DLF
echo %var%
>> DLF

# 3. if-else
set age=19
if %age% geq 18(echo Adult) else (echo cute!)
>> cute!
Window command prompt (CMD) # 4. for loop
for %i in (1 2 3 4 5) do (echo Number: %i)
>> 1 2 3 4 5

Robust Physical AI School of Energy


6
& Robotics Lab. Engineering
What is Programming?

New idea! Design algorithm Write a source code Test program

Programming
“the process of designing, writing, testing, and maintaining
a sequence of instructions (a program) to solve a problem.”

Robust Physical AI School of Energy


8
& Robotics Lab. Engineering
Programming
• Algorithm
- A set of rules or steps used to solve a problem
# define functions
• Function def read_list():

- A block of reusable code, a way of grouping related steps
def sort_list():

• Data Structure def print_list():



- A particular way of organizing data in a computer
# main body
read_list()
sort_list()
[Link] print_list()
[Link]

Robust Physical AI School of Energy


9
& Robotics Lab. Engineering
Standard data types in Python
• A data type defines the kind or category of data (integer, float, string, etc)
• We can assign various types of data to a variable.
Python – Data Types

Numeric Boolean None Dictionary Set Sequence Type

Integer Float Complex number Strings List Tuple

Data types Examples Data types Examples Data types Examples


Integer …, -2, -1, 0, 1, ... Bool True, False Set {1, 0.3, “a”, “ab”}
Float 3.2, -0.14, 35.75 String “Hi, data!”, “123” List [1, 0.3, “a”, “ab”]
Complex 1+3j Dictionary {1:”a”, 2: “b”} Tuple (1, 0.3, “a”, “ab”)
Robust Physical AI School of Energy
10
& Robotics Lab. Engineering
Procedural Programming
• What is Procedural Programming?
➔ Think of a program as a set of “Procedure”

• To built a program, # define functions


Q. What kinds of “Procedures” are necessary? def read_list():

def sort_list():
• What is procedure? …

• A block of code that performs a specific task def print_list():


• A unit of work or step in the overall program …

• Different languages use different terms # main body


: e.g., procedure (pascal), function (C, python), read_list()
sort_list()
subroutine (fortran), method (Python), etc print_list()

Robust Physical AI School of Energy


11
& Robotics Lab. Engineering
Object-oriented Programming
• What is Object-oriented Programming?
➔ Think of a program as a set of “Object” Object Object

Data Data
• To built a program,
Q. What kinds of “Object” are necessary?
Function Function

• What is object?
Function Function
• A unit that has state (i.e., data), behavior
(i.e., function), and identity.
• Resembles real-life entities with state and
action.
• An instance of a class.
Robust Physical AI School of Energy
12
& Robotics Lab. Engineering
Organizing Program Logic in Python
As programs grow larger, we need bigger “containers” to organize logic:

• Functions: A block of code that performs a specific task.

• Objects: An entity that combines data (attributes) and behavior (methods)

• Modules: A single Python file (.py) containing functions, classes, or variables.

• Libraries: A collection of modules organized together, often distributed for reuse.

Robust Physical AI School of Energy


13
& Robotics Lab. Engineering
A lots of python libraries …

Over 100,000+ libraries!


✓ Cannot cover each library & its usage & functions & …
Not my job ^-^; that is your job!
Robust Physical AI School of Energy
14
& Robotics Lab. Engineering
A lots of python libraries …
Data Data analyze & visualization
• Number: 10293, 37.2℃, 175cm, 70kg, …
• Text: “It is raining today”, SNS’s post, News, …
• Signals: images, videos, audio, electric signal, …

Weather
Stock price

Trajectory
Robust Physical AI School of Energy
& Robotics Lab. Engineering
A lots of python libraries …
• Pandas → Tabular data analysis (filtering, grouping, …)

• NumPy → Scientific computing, numerical operations for multi-


dimensional arrays

• Matplotlib / Seaborn → Data visualization (histogram, heat map, pie


chart, graph, …)

• Requests → HTTP communication library, used for REST API calls,


downloading files, interacting with websites

• BeautifulSoup → Web Scarping library, parses HTML/XML


documents, extract titles, links, tables, or any structured web content,
often used together with Requests
Robust Physical AI School of Energy
& Robotics Lab. Engineering
A lots of python libraries …

• Pillow → Image processing library, easy to use with Tkinter and PIL
(Python Imaging Library)

• OpenCV → computer vision toolkit for image and video processing

• Scikit-learn → Machine learning toolkit (classification, regression,


clustering, K-means)

• PyTorch/TensorFlow/ Keras → High-performance deep learning


framework

Robust Physical AI School of Energy


& Robotics Lab. Engineering
Python package installation
Pip (Python Package Installer)
• Python provides pip, the official package installer, for downloading and managing
external libraries
• Downloads packages from PyPI (Python Package Index, [Link] )
• Supports library installation, upgrade, removal, dependency handling
• Included by default in most Python distribution

In your CMD or powershell or VScode terminal


Robust Physical AI School of Energy
& Robotics Lab. Engineering
Python package installation
Pip (Python Package Installer)
• Python provides pip, the official package installer, for downloading and managing
external libraries
• Downloads packages from PyPI (Python Package Index, [Link] )
• Supports library installation, upgrade, removal, dependency handling
• Included by default in most Python distribution
# basic installation command # check installed packages
pip install matplotlib pip list
pip show matplotlib
# installation with specific version
pip install pandas==1.5.0 # uninstall a package
pip uninstall matplotlib
# upgrade an existing package
pip install --upgrade matplotlib

Robust Physical AI School of Energy


& Robotics Lab. Engineering
Python package installation
Wait! Where is my python package located in?
• $ python –c “import sys, pprint; [Link]([Link])”

Robust Physical AI School of Energy


& Robotics Lab. Engineering
Matplotlib and word cloud

Matplotlib Word cloud


: data visualization (histogram, : generates visual “word clouds”
heat map, pie chart, graph, …) from text frequency
Package: [Link] Package: [Link]
Source: [Link] Source: [Link]
Document: Document:
[Link] [Link]

Robust Physical AI School of Energy


& Robotics Lab. Engineering
Matplotlib
$ pip install matplotlib wordcloud
> On your window CMD, powershell, VScode terminal

Robust Physical AI School of Energy


& Robotics Lab. Engineering
Matplotlib
Matplotlib
: one of the most widely used Python plotting libraries
> Line plot, bar charts, Pie charts, 3D plot
> 1D data, 2D image, 3D data, …

Robust Physical AI School of Energy


& Robotics Lab. Engineering
Matplotlib
Matplotlib
: one of the most widely used Python plotting libraries
> Line plot, box plot, bar charts, Pie charts, 3D plot
> 1D data, 2D image, 3D data, …
import [Link] as plt Line plot
X = [ "Mon", "Tue", "Wed", "Thur", "Fri", "Sat", "Sun" ]
Y = [15.6, 14.2, 16.3, 18.2, 17.1, 20.2, 22.4]

[Link](X, Y)
[Link]("day") # x-axis label
[Link]("temperature") # y-axis label
[Link]()

Robust Physical AI School of Energy


& Robotics Lab. Engineering
Matplotlib
Matplotlib
: one of the most widely used Python plotting libraries
> Line plot, box plot, bar charts, Pie charts, 3D plot
> 1D data, 2D image, 3D data, …
import [Link] as plt

X = [ "Mon", "Tue", "Wed", "Thur", "Fri", "Sat", "Sun" ]


Y1 = [15.6, 14.2, 16.3, 18.2, 17.1, 20.2, 22.4]
Y2 = [20.1, 23.1, 23.8, 25.9, 23.4, 25.1, 26.3]

[Link](X, Y1, label="Seoul")


[Link](X, Y2, label="Busan")
[Link]("day")
[Link]("temperature")
[Link](loc="upper left")
[Link]("Temperatures of Cities")
[Link]()
Robust Physical AI School of Energy
& Robotics Lab. Engineering
Matplotlib
Matplotlib
: one of the most widely used Python plotting libraries
> Line plot, box plot, bar charts, Pie charts, 3D plot
> 1D data, 2D image, 3D data, …
import [Link] as plt

Y1 = [15.6, 14.2, 16.3, 18.2, 17.1, 20.2, 22.4]


Y2 = [20.1, 23.1, 23.8, 25.9, 23.4, 25.1, 26.3]

[Link]([Y1, Y2]
[Link]([1, 2], [“City A”, “City B”])
[Link]("temperature")
[Link]("Temperatures of Cities")
[Link]()

Robust Physical AI School of Energy


& Robotics Lab. Engineering
Matplotlib
import [Link] as plt

[Link]([15.6, 14.2, 16.3, 18.2, 17.1, 20.2, 22.4], "sm")


[Link]()

X = [ "Mon", "Tue", "Wed", "Thur", "Fri", "Sat", "Sun" ]


Y = [15.6, 14.2, 16.3, 18.2, 17.1, 20.2, 22.4]
[Link](X, Y)
[Link]()

Y = [38, 22, 15, 25]


labels = ["Apples", "Pear", "Strawberry", "Cherries"]
explode = [0.1, 0, 0, 0]

[Link](Y, labels = labels, explode = explode)


[Link]()

Robust Physical AI School of Energy


& Robotics Lab. Engineering
Lab 1. Matplotlib
1. [Performance comparison graph] Let’s say you have trained three different AI models:
• Model 1: accuracy 64.3 %
• Model 2: accuracy 79.3 %
• Model 3: accuracy 95.3 %
Draw three types of graphs: a bar graph, line plot, and pie chart, and discuss which of these graphs the
most effectively shows the performance difference
Example input/output:

Robust Physical AI School of Energy


& Robotics Lab. Engineering
Word Cloud
Word Cloud
: Generates visual “word clouds” from text frequency
: Larger font size = more frequent word
: Useful for summarizing text, exploring NLP datasets, and analyzing news or social
media

Robust Physical AI School of Energy


& Robotics Lab. Engineering
Word Cloud
import [Link] as plt
from wordcloud import WordCloud

text=""
with open("[Link]", "r", encoding="utf-8") as f:
lines = [Link]()
for line in lines:
text += line
text = "Python text data visualization wordcloud"

wc = WordCloud(width=600, height=400)

[Link](text)
wc.to_file("[Link]")

[Link](figsize=(30, 10))
[Link](wc)
[Link]()

Robust Physical AI School of Energy


& Robotics Lab. Engineering
NumPy and OpenCV

NumPy (Numerical Python) OpenCV


: Efficient data representation : Open-source computer vision library
(ndarray) for scientific computing (image, video)
Package: [Link] Package: [Link]
Source: [Link] Source: [Link]
Document: [Link] Document:
[Link]

Robust Physical AI School of Energy


& Robotics Lab. Engineering
NumPy and OpenCV
$ pip install numpy opencv-python
> On your window CMD, powershell, VScode terminal

Robust Physical AI School of Energy


& Robotics Lab. Engineering
NumPy
NumPy (Numerical Python)
: The fundamental package for scientific computing, numerical operation, linear
algebra, matrix operations.
: Provides ndarray, a fast and memory-efficient n-dimensional array
: Backbone lineary used by PyTorch, TensorFlow, OpenCV, Pandas, SciPy, etc
: Much faster than Python lists

Robust Physical AI School of Energy


& Robotics Lab. Engineering
NumPy
import numpy as np
ndarray
# (1) creating arrays
• In NumPy, a Fundamental data structure x_1d = [Link]([1, 2, 3.2]) #1D array
used to represent multi-dimensional arrays x_2d = [Link]([[1,2],[3,4]]) # 2D
x_3d = [Link](3, 256, 256) # 3D
• Scalar (0D), Vector (1D), Matrix (2D), x_4d = [Link](10, 3, 256, 256) # 4D
x_5d = [Link](4,3,3,5,5) # 5D
higher-dimensional array (≥ 3D)
• Attribute: # (2) printing ndarray properties
print(x_2d.shape, x_2d.dtype,
• shape : dimensions x_2d.size, , x_2d.ndim)
# (2,2), float64, 4, 2
• dtype : data type
# more...
• size : total number of elements dir(x_2d)
• ndim: rank (# of axes)

Robust Physical AI School of Energy


34
& Robotics Lab. Engineering
Motor input voltage
Tensor PWM signal
(T × Voltage)
• Scalar (0D) [12V, 6V, 3V, 12V, …]
: e.g., single data point, such as
temperature (25°C), voltage value, … Time series representation
(T × Power (kWh))
[100, 200, 210, …]
• Vector (1D) Power consumption,
: e.g., Time-series scalar data generation, loss, …
(audio, electric signal, …), feature, …
Audio waveform
: 1D amplitudes
(T × 16,000)
• Matrix (2D)
[-0.1, 1.0, 0.7, …]
: e.g., Time-series vector data, Gray-scale Assuming sampling at 16KHz

image, …
* Other electric waves also have similar form [-0.3, 0.1, 0.4, …]
(Bluetooth, 5G, communication, medical equipment)

Robust Physical AI School of Energy


35
& Robotics Lab. Engineering
Audio spectrogram
Tensor : 2D representation
(frequency × Time)
• Matrix (2D)
: e.g., Time-series vector data, Gray-scale Video
RGB image
image, … 127 0 …
127 0 …
127 0 …
64 2 …
64 2 …
64 2 …
• Tensor (3D Data) …




: e.g., RGB-scale image, mesh, … … … …

RGB values × resolution Time × RGB values × resolution


3×3840×2160 T×3×3840×2160
• Tensor (4D Data) LiDAR
# of measurement × [X, Y, Z, Intensity]
: e.g., RGB video, Lidar point, … N×4
[0, 0, 0, 128]
[5, 3, 64, 128]
[13, 77, 0, 128]
• Higher-dimensional array (≥ 5D) …
: e.g., Lidar point cloud, RADAR, … LiDAR sensor

Robust Physical AI School of Energy


36
& Robotics Lab. Engineering
NumPy – Slicing & Indexing
• Indexing & slicing
# (3) indexing, slicing, Boolean masking 0 1 2
import numpy as np
array2d = [Link]([[10, 20, 30], 0 10 20 30
[40, 50, 60],
[70, 80, 90]])
1 40 50 60

# (3-1) indexing: (0,1)


70 80 90
print(f’array2d[0, 1] = {array2d[0, 1]}') # 20 2
# (3-2) row slicing: from row 1 to the end
print(f’array2d[1:, :] =\n {array2d[1:, :]}’)

# (3-3) Boolean masking


mask = array2d > 50
print(f'mask:\n {mask}')
print(f’bigger than 50: {tensor2d[mask]}')

Robust Physical AI School of Energy


37
& Robotics Lab. Engineering
NumPy – Linear Algebra Operation
• Linear Algebra Operations
# (4) Linear Algebra Operations
import numpy as np

A2d = [Link]([[1,2],[3,4]])
B2d = [Link]([[5,6],[7,8]])

print([Link](A2d, B2d)) # matrix multiplication


print([Link](A2d)) # matrix transpose
print([Link](A2d)) # matrix inverse
print([Link](A2d)) # eigenvalues

# (5) other ndarray methods


print([Link]()); print([Link]()); print([Link]());
print([Link]()); print([Link]()); print([Link]())

Robust Physical AI School of Energy


38
& Robotics Lab. Engineering
NumPy – list to NumPy
• Converting list to numpy array
# (6) List to NumPy
import numpy as np
import [Link] as plt

ftemp_lst = [63, 73, 80, 86, 84, 78, 66, 54, 45, 63]
ftemp_ary = [Link](ftemp_lst)

print(ftemp_lst) # python list


print(ftemp_ary) # numpy ndarray

ctemp_ary = (ftemp_ary-32.)*5/9
[Link](ctemp_ary)
[Link]("index")
[Link]("temperature")
[Link]()

Robust Physical AI School of Energy


39
& Robotics Lab. Engineering
NumPy – list to NumPy
• NumPy creating with NumPy methods (arrange, linspace, rand)
# (7) Array with arrange, linsapce, rand
import numpy as np
import [Link] as plt

arange_array = [Link](0, 10, 2) # (start, stop, step), 0, 2, 4, 6, 8


linspace_array = [Link](0, 1, 5) # (start, stop, num), 0, 0.25, 0.5, 0.75, 1
[Link](arange_array)
[Link]()

X = [Link](-2*[Link], 2*[Link], 100) # [-2𝜋, 2𝜋], 100 samples


Y1 = [Link](X) # Y = sin(X)
Y2 = 3*[Link](X) # Y = 3*sin(X)

[Link](X,Y1,X,Y2)
[Link]()

Robust Physical AI School of Energy


40
& Robotics Lab. Engineering
NumPy – list to NumPy
• NumPy creating with NumPy methods (arrange, linspace, rand)
# (7) Array with arrange, linsapce, rand
import numpy as np
import [Link] as plt

rand_1d_array = [Link](5) # uniform distribution within [0,1]


randn_1d_array = [Link](5) # gaussian normal dist(mean:0, std:1)
rand_2d_array = [Link](5,5)# 2d array
randn_1d_array = [Link](1, 2, 100) # gaussian normal dist(mean:1, std:2)

mu, sigma = 10, 2


Y1 = [Link](10000)
Y2 = [Link](10000)
Y3 = mu + sigma*[Link](10000)
[Link](Y1,bins=20); [Link]()
[Link](Y2,bins=20); [Link](Y3,bins=20); [Link]()

Robust Physical AI School of Energy


41
& Robotics Lab. Engineering
Lab 2. NumPy
1. [Draw graph] Draw graph 1(𝑌 = 1, 𝑌 = 𝑋, 𝑌 = 𝑋 2 ) and graph 2 (𝑌 = 𝑋 + 𝑁𝑜𝑖𝑠𝑒), Noise is
sampled from guassian normal distributions

Example input/output:

Robust Physical AI School of Energy


42
& Robotics Lab. Engineering
OpenCV
OpenCV (Open Source Computer Vision Library)
: A powerful library for image processing, computer vision, feature extraction,
object detection, video processing
: written in C/C++, with Python bindings
: widely used in AI and Robotics

Image blending

Template Matching Object tracking Classification, detection, segmentation


Robust Physical AI School of Energy
& Robotics Lab. Engineering
OpenCV import cv2
import [Link] as plt

Reading, Showing, Writing Image # (1) reading and writing images


# OpenCV loads images as BGR, not RGB
• OpenCV utilizes NumPy’s ndarray to img = [Link]("opencv_logo.png") # BGR
represent images or videos [Link](“output_img.jpg”, img)

• Attribute: # (2) displaying images


[Link]("Image", img)# need BGR format
• shape : dimensions [Link](0)
(height, width, channels) [Link]()

• dtype : data type [Link](img) # need RGB format


(uint8, 0 - 255) [Link]()

• size : total number of elements # (3) Image properties


print([Link], [Link], [Link],
• ndim: rank (# of axes) [Link])
# (739,600,3), uint8, 1330200, 3

Robust Physical AI School of Energy


46
& Robotics Lab. Engineering
OpenCV
• Converting Color Space
import cv2
import [Link] as plt
import numpy as np

# (4) Converting Color Space


img = [Link]("opencv_logo.png") # BGR
rgb = [Link](img, cv2.COLOR_BGR2RGB) # RGB
gray = [Link](img, cv2.COLOR_BGR2GRAY) # GRAY

[Link](1,3,1); [Link](img); [Link]("off");


[Link](1,3,2); [Link](rgb); [Link]("off");
[Link](1,3,3); [Link]([Link](gray[:,:,None],3,axis=2));[Link]("off");
[Link]("output_img.jpg")
[Link]()

Robust Physical AI School of Energy


& Robotics Lab. Engineering
OpenCV
• Image Resizing & Cropping
import cv2
import [Link] as plt
import numpy as np

# (5) Image Resizing & Cropping


img = [Link]("kentech_logo.png") # BGR, (110, 459, 3)
resized = [Link](img, (300,300)) # BGR, (300, 300, 3)
cropped = img[70:110, :, :] # BGR, (40, 459, 3)

[Link]("Image", img); [Link](1000)


[Link]("Image", resized); [Link](1000)
[Link]("Image", cropped); [Link](1000)
[Link]()

Robust Physical AI School of Energy


& Robotics Lab. Engineering
OpenCV
• Image Blending
import cv2
import [Link] as plt
import numpy as np

# (6) Image Blending


img = [Link]("kentech_logo.png") # BGR, (110, 459, 3)
resized = [Link](img, (300,300)) # BGR, (300, 300, 3)

img2 = [Link]("opencv_logo.png") # BGR, (739, 600, 3)


resized2 = [Link](img2, (300,300)) # BGR, (300, 300, 3)

img3 = (0.5*resized + 0.5*resized2)).astype(np.uint8)

[Link]("Image", img3)
[Link](0)
[Link]()
Robust Physical AI School of Energy
& Robotics Lab. Engineering
OpenCV
• Edge Detection (Canny) & Blurring
import cv2
import [Link] as plt
import numpy as np

# (7) Edge detection & Blurring


img = [Link]("kentech_logo.png",cv2.IMREAD_GRAYSCALE) # gray, (110, 459)
edges = [Link](img, 100, 200) # lower/upper threshold
blur = [Link](img, (5,5), 0) # kernel size (5x5), sigma 0

[Link]("Image", img); [Link](1000)


[Link]("Image", edges); [Link](1000)
[Link]("Image", blur); [Link](1000)
[Link]()

Robust Physical AI School of Energy


& Robotics Lab. Engineering
OpenCV
• Drawing on Images
import cv2
import [Link] as plt
import numpy as np

# (8) Drawing on Images


img = [Link]("opencv_logo.png")
img2 = [Link](img, (100,100), 30, (0,255,0), 3) # center,radius,color,thick
img3 = [Link](img, (50,50), (150,150), (255,0,0), 2)
img4 = [Link](img, "Hello", (50,200), cv2.FONT_HERSHEY_SIMPLEX, 1, (0,0,0),
2)

[Link]([Link](img, cv2.COLOR_BGR2RGB))
[Link]("off")
[Link]()

Robust Physical AI School of Energy


& Robotics Lab. Engineering
OpenCV
• Color distribution analysis
import cv2
import [Link] as plt
# (9) Color distribution analysis
img = [Link]("kentech_logo.png") # BGR
img_B = img[:,:,0] # B
img_G = img[:,:,1] # G
img_R = img[:,:,2] # R
B, G, R = [Link](img)

[Link](figsize=(10,5))
[Link]([Link]([R], [0], None, [256], [0,256]), color='red')
[Link]([Link]([G], [0], None, [256], [0,256]), color='green')
[Link]([Link]([B], [0], None, [256], [0,256]), color='blue')
[Link]("RGB Color Histogram“); [Link]("Pixel Intensity");
[Link]("Frequency"); [Link](["Red","Green","Blue"])
[Link]()
Robust Physical AI School of Energy
& Robotics Lab. Engineering
OpenCV
• Webcam
import cv2

# (10) Basic webcam (video) processing


cap = [Link](0)
While True:
ret, frame = [Link]() # Capture a frame
if not ret:
break
[Link]("Webcam", frame) # Display the frame

# Press 'q' to exit


if [Link](1) & 0xFF == ord('q'):
break

[Link]() # Release the camera


[Link]()
Robust Physical AI School of Energy
& Robotics Lab. Engineering
Lab 3. OpenCV
1. [Image Composition] Download two random images (one: background, one: foreground image with
green chroma key) and composite them together.

Example input/output:

Robust Physical AI School of Energy


54
& Robotics Lab. Engineering
Summary
[Python Library]
• [Recap] Important thing is a logical thinking!
• Python Library
• Matplotlib
: Data visualization (histogram, heat map, pie chart, graph, …)
• Word Cloud
: Generates visual “word clouds” from text frequency
• Pandas
: Provides DataFrame and Series structures for CSV, Excel, and JSON data
• Numpy
: Fundamental package for scientific computing, numerical operation, linear algebra, matrix
operations.
• OpenCV
: A powerful library for image processing, computer vision, feature extraction, object detection,
video processing
Robust Physical AI School of Energy
55
& Robotics Lab. Engineering
Q&A

Robust Physical AI School of Energy


56
& Robotics Lab. Engineering

You might also like