데이터 재료과학 (제 2강)

데이터 분석/해석 및 시각화(그래프) 등 기초 컴퓨터 활용 능력

1. 목표

2. Python 환경 확인

2.1. 파이썬

2.2. VS code에서 JuPyter 셋업 & 구동되어 있는가?

2.3 CLI (command line interface 기초)

Source / version control via Git

3. 모듈 만들기 및 실습

에러 메시지 1.

 Traceback (most recent call last):
   File "/Users/youngung/repo/lectures/1_2_data_mse/ex/01_Hello/hello.py", line 1, in <module>
     xprint('Hello, world')
     ^^^^^^
 NameError: name 'xprint' is not defined. Did you mean: 'print'?

에러 메시지 2.

/Users/youngung/.pyenv/versions/3.12.2/bin/python: can't open file '/Users/youngung/repo/youngung.github.io/mdim.py': [Errno 2] No such file or directory

4. 간단한 조작 실습

5. 변수와 연산자

6. 예시

6.1. 실습 예시 2-1

$ pip install numpy scipy matplotlib jupyter
$ python

Python 3.12.2 (main, Mar 29 2024, 06:39:27) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
>>> scipy.__file__
'/Users/youngung/.pyenv/versions/3.12.2/lib/python3.12/site-packages/scipy/__init__.py'
>>>

6.2. 실습 예시 2-2

\[25 \text{ cm} \times \frac{0.393 \text{ inch}}{1 \text{ cm}}=25 \text{ cm} \times \frac{0.393 \bcancel{\text{ ch}}}{1 \bcancel{\text{cm}}}\] \[=25 \text{ cm} \times 0.393= 9.825 \text{ cm}.\]

6.3. 실습 예시 2-3

## 예시
c = float(input("섭씨 온도: "))
f = c * 9/5 + 32
print(f"{c:.2f}C= {f:.2f}F")

6.4. 실습 예시 2-4