SlideShare a Scribd company logo
Data Analysis and Visualization
with Python and node.js
2022.7
강태욱 연구위원
공학박사
Ph.D Taewook, Kang
laputa99999@gmail.com
daddynkidsmakers.blogspot.com
Maker, Ph.D.
12 books author
TK. Kang
Data Analysis
Data Analysis
개발 환경 필수 설치
Python 설치 (아래 링크 클릭해 설치)
import sys
sys.executable
Command 터미널(명령창)에서 python 실행 후 아래 명령어 입력해, 설치 여부 확인
https://www.python.org/downloads/
개발 환경 필수 설치
pip install numpy scipy matplotlib pandas pygame
Command 창에서 아래 명령 실행해 라이브러리 패키지 설치
개발 환경 필수 설치
Git 설치
https://git-scm.com/downloads
개발 환경 필수 설치
Node 설치
https://nodejs.org/en/download/
개발 환경 필수 설치
coding editor 설치
https://www.sublimetext.com/3
개발 환경 옵션 설치
Vscode 설치
https://code.visualstudio.com/download
개발 환경 옵션 설치
개발 환경 옵션 설치
Anaconda 설치
https://www.anaconda.com/products/distribution
개발 환경 옵션 설치
Welcome To Colaboratory - Google Research
Python
print("Hello, World!")
if 5 > 2:
print("Five is greater than two!")
x = 5
y = "Hello, World!"
def my_function():
print("Hello from a function")
my_function()
Python
elements = {"hydrogen": 1, "helium": 2, "carbon": 6}
Python
class Cat:
animal = ‘cat'
# The init method or constructor
def __init__(self, breed):
# Instance Variable
self.breed = breed
# Adds an instance variable
def setColor(self, color):
self.color = color
# Retrieves instance variable
def getColor(self):
return self.color
# Driver Code
koko = Cat(“british")
koko.setColor("brown")
print(koko.getColor())
PADAS
https://pandas.pydata.org/
PADAS
matplotlib
https://matplotlib.org/stable/plot_typ
es/index.html
numpy
https://numpy.org/
Data Analysis
import pandas as pd
import matplotlib.pyplot as plt
data = {'Unemployment_Rate': [6.1,5.8,5.7,5.7,5.8,5.6,5.5,5.3,5.2,5.2],
'Stock_Index_Price': [1500,1520,1525,1523,1515,1540,1545,1560,1555,1565]
}
df = pd.DataFrame(data,columns=['Unemployment_Rate','Stock_Index_Price'])
df.plot(x ='Unemployment_Rate', y='Stock_Index_Price', kind = 'scatter')
plt.show()
https://matplotlib.org/stable/api/index.html
Data Analysis
Data Analysis
import pandas as pd
import matplotlib.pyplot as plt
data = {'Year': [1920,1930,1940,1950,1960,1970,1980,1990,2000,2010],
'Unemployment_Rate': [9.8,12,8,7.2,6.9,7,6.5,6.2,5.5,6.3]
}
df = pd.DataFrame(data,columns=['Year','Unemployment_Rate'])
df.plot(x ='Year', y='Unemployment_Rate', kind = 'line')
plt.show()
Data Analysis
Data Analysis
import pandas as pd
import matplotlib.pyplot as plt
data = {'Country': ['USA','Canada','Germany','UK','France'],
'GDP_Per_Capita': [45000,42000,52000,49000,47000]
}
df = pd.DataFrame(data,columns=['Country','GDP_Per_Capita'])
df.plot(x ='Country', y='GDP_Per_Capita', kind = 'bar')
plt.show()
Data Analysis
Data Analysis
import pandas as pd
import matplotlib.pyplot as plt
data = {'Tasks': [300,500,700]}
df = pd.DataFrame(data,columns=['Tasks'],index = ['Tasks Pending','Tasks
Ongoing','Tasks Completed'])
df.plot.pie(y='Tasks',figsize=(5, 5),autopct='%1.1f%%', startangle=90)
plt.show()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.plot.html
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.plot.pie.html
Data Analysis
Data Analysis
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure(figsize=(4,4))
ax = fig.add_subplot(111, projection='3d')
ax.scatter(2,3,4) # plot the point (2,3,4) on the figure
plt.show()
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.figure.html
https://www.statology.org/fig-add-subplot/
Data Analysis
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
x = np.linspace(-4 * np.pi, 4 * np.pi, 50)
y = np.linspace(-4 * np.pi, 4 * np.pi, 50)
z = x**2 + y**2
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot(x,y,z)
plt.show()
Data Analysis
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
np.random.seed(42)
xs = np.random.random(100)*10 + 20
ys = np.random.random(100)*5 + 7
zs = np.random.random(100)*15 + 50
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(xs,ys,zs)
plt.show()
Data Analysis
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
np.random.seed(42)
ages = np.random.randint(low = 8, high = 30, size=35)
heights = np.random.randint(130, 195, 35)
weights = np.random.randint(30, 160, 35)
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(xs = heights, ys = weights, zs = ages)
ax.set_title("Age-wise body weight-height distribution")
ax.set_xlabel("Height (cm)")
ax.set_ylabel("Weight (kg)")
ax.set_zlabel("Age (years)")
plt.show()
Data Analysis
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
np.random.seed(42)
ages = np.random.randint(low = 8, high = 30, size=35)
heights = np.random.randint(130, 195, 35)
weights = np.random.randint(30, 160, 35)
bmi = weights / ((heights * 0.01)**2)
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(xs = heights, ys = weights, zs = ages, s=bmi*5 )
ax.set_title("Age-wise body weight-height distribution")
ax.set_xlabel("Height (cm)")
ax.set_ylabel("Weight (kg)")
ax.set_zlabel("Age (years)")
plt.show()
Data Analysis
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from scipy.stats import multivariate_normal
X = np.linspace(-5,5,50)
Y = np.linspace(-5,5,50)
X, Y = np.meshgrid(X,Y)
X_mean = 0; Y_mean = 0
X_var = 5; Y_var = 8
pos = np.empty(X.shape+(2,))
pos[:,:,0]=X
pos[:,:,1]=Y
rv = multivariate_normal([X_mean, Y_mean],[[X_var, 0], [0, Y_var]])
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(X, Y, rv.pdf(pos), cmap="plasma")
plt.show()
Data Analysis
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import numpy as np
fig = plt.figure()
ax = fig.gca(projection='3d')
# Make data.
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)
# Plot the surface.
surf = ax.plot_surface(X, Y, Z, cmap=cm.coolwarm,
linewidth=0, antialiased=False)
# Customize the z axis.
ax.set_zlim(-1.01, 1.01)
ax.zaxis.set_major_locator(LinearLocator(10))
ax.zaxis.set_major_formatter(FormatStrFormatter('%.02f'))
# Add a color bar which maps values to colors.
fig.colorbar(surf, shrink=0.5, aspect=5)
plt.show()
Data Analysis
Data Analysis
https://plotly.com/python/3d-charts/
AI
AI
AI
https://colab.research.google.com/github/tensorflow/tpu/blob/master/models/offici
al/mask_rcnn/mask_rcnn_demo.ipynb
AI
https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipy
nb
Data Analysis
Game
pip install pygame
Game
https://github.com/Hakkush-07/pygame-3D
https://git-scm.com/downloads
Game
https://www.panda3d.org/download/sdk-1-10-11/
pip install panda3d
Modeling
https://www.tinkercad.com/things/fcTDgpaAdB3-stunning-borwo-sango/edit
Modeling
import numpy as np
from stl import mesh
# Define the 8 vertices of the cube
vertices = np.array([
[-1, -1, -1],
[+1, -1, -1],
[+1, +1, -1],
[-1, +1, -1],
[-1, -1, +1],
[+1, -1, +1],
[+1, +1, +1],
[-1, +1, +1]])
# Define the 12 triangles composing the cube
faces = np.array([
[0,3,1],
[1,3,2],
[0,4,7],
[0,7,3],
[4,5,6],
[4,6,7],
[5,1,2],
[5,2,6],
[2,3,6],
[3,7,6],
[0,1,5],
[0,5,4]])
# Create the mesh
cube = mesh.Mesh(np.zeros(faces.shape[0], dtype=mesh.Mesh.dtype))
for i, f in enumerate(faces):
for j in range(3):
print(vertices[f[j],:])
cube.vectors[i][j] = vertices[f[j]]
# Write the mesh to file "cube.stl"
cube.save('cube.stl')
javascript
javascript
let input;
if (input === undefined) {
doThis();
} else {
doThat();
}
const n = null;
console.log(n * 32); // Will log 0 to the
console
foo(); // "bar"
/* Function declaration */
function foo() {
console.log('bar');
}
javascript
class Car {
constructor(name, year) {
this.name = name;
this.year = year;
}
age() {
let date = new Date();
return date.getFullYear() - this.year;
}
}
let myCar = new Car("Ford", 2014);
document.getElementById("demo").innerHTML =
"My car is " + myCar.age() + " years old.";
node.js
node.js
node.js
node.js
node.js
node.js
node.js
node.js
node.js
npm install express
npm install three
npm install http-server
node.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>My first three.js app</title>
<style>
body { margin: 0; }
</style>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r83/three.js"></script>
<script>
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1,
1000 );
const renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
node.js
const geometry = new THREE.BoxGeometry( 1, 1, 1 );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
const cube = new THREE.Mesh( geometry, material );
scene.add( cube );
camera.position.z = 5;
function animate() {
requestAnimationFrame( animate );
cube.rotation.x += 0.01;
cube.rotation.y += 0.01;
renderer.render( scene, camera );
};
animate();
</script>
</body>
</html>
node.js
node.js
https://github.com/stemkoski/stemkoski.github.com
node.js
https://three-nebula.org/examples/gpu-renderer
node.js
https://cs.wellesley.edu/~cs307/threejs/r67/examples/#webgl_animation_cloth
node.js
https://threejs.org/examples/#webgl_interactive_cubes
node.js
https://threejs.org/examples/#webgl_animation_keyframes
node.js
https://ifcjs.github.io/info/docs/Hello%20world
node.js
https://cesium.com/use-cases/digital-twins/
DX
Reference

More Related Content

PPTX
Civil Engineering Admission Prospectus.pptx
PDF
02. REGLAMENTO DE INCENTIVOS DE ORDENAMIENTO TERRITORIAL.pdf
PDF
Anchorage and lap splicing Detailing of slabs, columns, beams, footings
PDF
Shallow Foundations
PDF
Design and Development of BIM on GIS Interoperability Open Platform
PPTX
Base isolator presentation
DOC
Check list
PDF
ISO 19166 BIM to GIS conceptual mapping China (WUHAN) meeting
Civil Engineering Admission Prospectus.pptx
02. REGLAMENTO DE INCENTIVOS DE ORDENAMIENTO TERRITORIAL.pdf
Anchorage and lap splicing Detailing of slabs, columns, beams, footings
Shallow Foundations
Design and Development of BIM on GIS Interoperability Open Platform
Base isolator presentation
Check list
ISO 19166 BIM to GIS conceptual mapping China (WUHAN) meeting

Similar to Python과 node.js기반 데이터 분석 및 가시화 (20)

PDF
SCIPY-SYMPY.pdf
PDF
Python Software Testing in Kytos.io
PPTX
matplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvf
PDF
Using the code below- I need help with creating code for the following.pdf
PPTX
2.3 SciPy library explained detialed 1.pptx
PDF
III MCS python lab (1).pdf
PPTX
Python Visualization API Primersubplots
PDF
Python matplotlib cheat_sheet
PDF
Py lecture5 python plots
PDF
Python seaborn cheat_sheet
PDF
matplotlib-installatin-interactive-contour-example-guide
PDF
Need helping adding to the code below to plot the images from the firs.pdf
PDF
Swift for tensorflow
PPTX
Python for Scientists
PDF
Refactoring to Macros with Clojure
PDF
Python grass
PPTX
My favorite slides
PDF
Profiling in Python
PPTX
Seminar PSU 10.10.2014 mme
PPTX
AI02_Python (cont.).pptx
SCIPY-SYMPY.pdf
Python Software Testing in Kytos.io
matplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvf
Using the code below- I need help with creating code for the following.pdf
2.3 SciPy library explained detialed 1.pptx
III MCS python lab (1).pdf
Python Visualization API Primersubplots
Python matplotlib cheat_sheet
Py lecture5 python plots
Python seaborn cheat_sheet
matplotlib-installatin-interactive-contour-example-guide
Need helping adding to the code below to plot the images from the firs.pdf
Swift for tensorflow
Python for Scientists
Refactoring to Macros with Clojure
Python grass
My favorite slides
Profiling in Python
Seminar PSU 10.10.2014 mme
AI02_Python (cont.).pptx
Ad

More from Tae wook kang (20)

PDF
Gen AI with LLM for construction technology
PDF
NVIDIA cuda programming, open source and AI
PDF
AI based computer vision use cases for researcher
PDF
How to install AI open source tool and environment
PDF
3D 모델러 ADDIN 개발과정 요약
PDF
오픈소스로 쉽게 따라해보는 Unreal과 IoT 연계 및 개발 방법 소개.pdf
PDF
BIM 표준과 구현 (standard and development)
PDF
ISO 19166 BIM-GIS conceptual mapping
PDF
SBF(Scan-BIM-Field) 기반 스마트 시설물 관리 기술 개발
PPTX
오픈소스 ROS기반 건설 로보틱스 기술 개발
PDF
한국 건설 기술 전망과 건설 테크 스타트업 소개
PDF
Coding, maker and SDP
PPTX
오픈 데이터, 팹시티와 메이커
PPTX
AI - Media Art. 인공지능과 미디어아트
PDF
건설 스타트업과 오픈소스
PPTX
블록체인 기반 건설 스마트 서비스와 계약
PDF
4차산업혁명과 건설, 그리고 블록체인
PDF
Case Study about BIM on GIS platform development project with the standard model
PPTX
도시 인프라 공간정보 데이터 커넥션-통합 기술 표준화를 위한 ISO TC211 19166 개발 이야기
PPTX
Smart BIM for Facility Management
Gen AI with LLM for construction technology
NVIDIA cuda programming, open source and AI
AI based computer vision use cases for researcher
How to install AI open source tool and environment
3D 모델러 ADDIN 개발과정 요약
오픈소스로 쉽게 따라해보는 Unreal과 IoT 연계 및 개발 방법 소개.pdf
BIM 표준과 구현 (standard and development)
ISO 19166 BIM-GIS conceptual mapping
SBF(Scan-BIM-Field) 기반 스마트 시설물 관리 기술 개발
오픈소스 ROS기반 건설 로보틱스 기술 개발
한국 건설 기술 전망과 건설 테크 스타트업 소개
Coding, maker and SDP
오픈 데이터, 팹시티와 메이커
AI - Media Art. 인공지능과 미디어아트
건설 스타트업과 오픈소스
블록체인 기반 건설 스마트 서비스와 계약
4차산업혁명과 건설, 그리고 블록체인
Case Study about BIM on GIS platform development project with the standard model
도시 인프라 공간정보 데이터 커넥션-통합 기술 표준화를 위한 ISO TC211 19166 개발 이야기
Smart BIM for Facility Management
Ad

Recently uploaded (20)

PDF
Lecture1 pattern recognition............
PDF
Clinical guidelines as a resource for EBP(1).pdf
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PPTX
Computer network topology notes for revision
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPTX
Introduction to machine learning and Linear Models
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
PPTX
Qualitative Qantitative and Mixed Methods.pptx
PPTX
climate analysis of Dhaka ,Banglades.pptx
PDF
Mega Projects Data Mega Projects Data
PDF
Business Analytics and business intelligence.pdf
PDF
Foundation of Data Science unit number two notes
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPTX
1_Introduction to advance data techniques.pptx
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
Lecture1 pattern recognition............
Clinical guidelines as a resource for EBP(1).pdf
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Computer network topology notes for revision
IBA_Chapter_11_Slides_Final_Accessible.pptx
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
Introduction to machine learning and Linear Models
oil_refinery_comprehensive_20250804084928 (1).pptx
Qualitative Qantitative and Mixed Methods.pptx
climate analysis of Dhaka ,Banglades.pptx
Mega Projects Data Mega Projects Data
Business Analytics and business intelligence.pdf
Foundation of Data Science unit number two notes
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
1_Introduction to advance data techniques.pptx
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
168300704-gasification-ppt.pdfhghhhsjsjhsuxush

Python과 node.js기반 데이터 분석 및 가시화