잠 못 드는 개발자
close
프로필 배경
프로필 로고

잠 못 드는 개발자

  • 분류 전체보기 (152)
    • Front-end (45)
      • HTML (25)
      • CSS (6)
      • JavaScript (7)
      • React (7)
    • Back-end (21)
      • SQL (2)
      • JAVA (13)
      • Spring (2)
      • Flask (4)
    • AI (64)
      • Python (32)
      • 모두의 딥러닝 (24)
      • NLP (7)
    • Android (5)
    • Git & Github (7)
    • IT 지식 (3)
    • Lecture (8)
  • 홈
  • 태그
  • 방명록
  • 글쓰기
[Flask] 애플리케이션 파일 생성, 플라스크 서버 실행

[Flask] 애플리케이션 파일 생성, 플라스크 서버 실행

애플리케이션 파일 생성 app = Flask(__name__) : 플라스크 애플리케이션 생성 __name__ : 모듈명이 담김 @app.route : URL과 플라스크 코드 매핑. 괄호 안에 있는 URL이 요청되면 플라스크는 아래에 있는 함수 실행 from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello World' 플라스크 서버 실행 c:\envs\myproject>flask run : FLASK_APP 환경 변수가 지정되지 않은 경우 자동으로 app.py 파일을 기본 애플리케이션으로 인식 : app.py 이외의 다른 파일을 실행하고 싶다면 FLASK_APP 환경 변수 값 수정 필요 c:\e..

  • format_list_bulleted Back-end/Flask
  • · 2023. 12. 30.
  • textsms

[라이브러리] 넘파이(Numpy) - ndarray, 메소드, 슬라이싱, 정수 인덱싱

넘파이(Numpy) - 수치 데이터를 다루는 파이썬 패키지 - 벡터 및 행렬을 사용하는 선형 대수 계산에서 주로 사용 - Numpy는 np라는 명칭으로 import 하는 것이 관례 import numpy as np np.array() - 리스트, 튜플, 배열로 부터 ndarray를 생성 - 축의 개수(ndim)와 크기(shape) 존재 import numpy as np vec = np.array([1, 2, 3, 4, 5]) print(vec) print("vec의 타입 :", type(vec)) [1 2 3 4 5] vec의 타입 : - 2차원 배열을 만들 때는 array() 안에 하나의 리스트만 들어가므로 리스트의 리스트를 넣어야 함 mat = np.array([[10, 20, 30], [40, 50..

  • format_list_bulleted AI/NLP
  • · 2023. 7. 7.
  • textsms
[라이브러리] 판다스(Pandas) - 시리즈(Series), 데이터프레임(DataFrame), 외부 데이터 읽기, 프로파일링(Profiling)

[라이브러리] 판다스(Pandas) - 시리즈(Series), 데이터프레임(DataFrame), 외부 데이터 읽기, 프로파일링(Profiling)

판다스(Pandas) - 파이썬 데이터 처리를 위한 라이브러리 - Pandas는 pd라는 명칭으로 import 하는 것이 관례 import pandas as pd 데이터 구조 종류 : 시리즈(Series), 데이터프레임(DataFrame), 패널(Panel) 시리즈(Series) - 1차원 배열의 값(values)에 각 값에 대응되는 인덱스(index)를 부여할 수 있는 구조 import pandas as pd sr = pd.Series([17000, 22000, 1000, 5000], index=["피자", "치킨", "콜라", "하이볼"]) print("시리즈 출력 :") print('-'*15) print(sr) 시리즈 출력 : --------------- 피자 17000 치킨 22000 콜라 10..

  • format_list_bulleted AI/NLP
  • · 2023. 7. 5.
  • textsms

[Python][Error] SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

오류 발생 과정 업로드된 파일을 지정된 위치("C:\Users\Downloads\student1.wav")에 저장하려고 함 f.save("C:\Users\Downloads\student1.wav") ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape SyntaxError : (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape 오류 발생 이유 - 유니코드 이스케이프(Unicode escape) 시퀀스가 올바르지 않을 때 발..

  • format_list_bulleted IT 지식
  • · 2023. 5. 19.
  • textsms
[모두의 딥러닝] 1. 폐암 수술 환자의 생존율 예측 코드 맛보기

[모두의 딥러닝] 1. 폐암 수술 환자의 생존율 예측 코드 맛보기

1. 환경 준비 - 딥러닝을 구동하거나 데이터를 다루는 데 필요한 라이브러리 호출 import : 라이브러리 호출하는 명령어 from (라이브러리명) import (함수명) : 라이브러리에 있는 모듈 중 일부만 호출하고 싶을 때 사용 import (라이브러리명) as (별명) : 불러온 라이브러리의 이름을 변경 from tensorflow.keras.models import Sequential # 텐서플로의 케라스 API에서 필요한 함수 호출 from tensorflow.keras.layers import Dense # 데이터를 다루는데 필요한 라이브러리 호출 import numpy as np 2. 데이터 준비 - 데이터를 불러와 사용할 수 있도록 준비 loadtxt() : csv 파일 불러옴 : 넘파이..

  • format_list_bulleted AI/모두의 딥러닝
  • · 2023. 5. 12.
  • textsms

[Python] 11-3장 객체 응용(Ball 클래스, TV 클래스 생성 등)

- Ball 클래스(터틀 그래픽) from turtle import * class Ball(Turtle): def __init__(self, color, speed, size): self.turtle = Turtle() self.turtle.shape("circle") self.x = 0 self.y = 0 self.color = color self.turtle.color(color, color) self.xspeed = speed self.yspeed = speed self.size = size def move(self): self.x += self.xspeed self.y += self.yspeed self.turtle.goto(self.x, self.y) ball = Ball("red", 1, 2)..

  • format_list_bulleted AI/Python
  • · 2023. 4. 11.
  • textsms

[Python] 11-2장 매직 메소드(__str__()), self, 객체 안의 객체, 상속

__str__() 메소드 - 객체의 데이터를 문자열로 변환할 때 사용 - print(인스턴스) 출력할 때 자동적으로 호출됨 class Car: def __init__(self, speed, color, model): self.speed = speed self.color = color self.model = model def drive(self): self.speed = 60 def __str__(self): msg = "속도 = "+str(self.speed)+" 색상 = "+self.color+" 모델 = "+self.model return msg myCar = Car(0, "red", "SUV") print(myCar) # 속도 = 0 색상 = red 모델 = SUV - 참고로 __str__() 메소..

  • format_list_bulleted AI/Python
  • · 2023. 4. 11.
  • textsms
  • navigate_before
  • 1
  • 2
  • 3
  • 4
  • ···
  • 6
  • navigate_next
공지사항
전체 카테고리
  • 분류 전체보기 (152)
    • Front-end (45)
      • HTML (25)
      • CSS (6)
      • JavaScript (7)
      • React (7)
    • Back-end (21)
      • SQL (2)
      • JAVA (13)
      • Spring (2)
      • Flask (4)
    • AI (64)
      • Python (32)
      • 모두의 딥러닝 (24)
      • NLP (7)
    • Android (5)
    • Git & Github (7)
    • IT 지식 (3)
    • Lecture (8)
최근 글
인기 글
최근 댓글
태그
  • #태그
  • #PYTHON
  • #딥러닝
  • #파이썬
  • #속성
  • #인공지능
  • #문법
  • #두근두근파이썬
  • #HTML
  • #모두의 딥러닝
전체 방문자
오늘
어제
전체
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바