본문 바로가기

전체 글17

[Python] Numpy 배열 리스트 : 자료형이 달라도 함께 묶일 수 있음.배열 : 동일한 자료형의 요소로 구성되어야 함. arr= np.array([1,2,3],              [4,5,6],              [7,8,9])print(arr[0,1]) 리스트와 차이점words = [    [["마", "크"], ["구", "이"]],    [["피", "아"], ["림", "차"]],    [["스", "사"], ["나", "가"]],]icecream= words[1][0][1]+words[0][1][1]+words[2][0][0]+words[0][0][1]+words[1][1][0]print(icecream) 리스트로 배열 접근방법words[1][2][3] 이런식으로 차원마다 괄호를 넣어준다. 넘파이 배열 접근방.. 2025. 1. 21.
[Python] 이미지 다운로드, 폴더생성, 윈도우 스크롤, from selenium import webdriverfrom bs4 import BeautifulSoupfrom webdriver_manager.chrome import ChromeDriverManagerfrom selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By #By 사용하기 위한 모듈from selenium.webdriver.common.keys import Keys #Keys 사용하기 위한 모듈 (엔터, 리턴 등)from selenium.webdriver.support.ui import WebDriverWait #webdriverwait를 사용하0기 위한 모듈from selenium.. 2025. 1. 20.
[Python] 리스트(list) # 리스트 선언 방식list=[1,2,3,4,5,6,7,"Hello","World","1"][대괄호]로 묶은 집합이며 파이썬에서만 정수와 문자열 등 다른 타입의 요소를 함께 가질 수 있다. # 인덱싱 (Indexing)list[7] #Hello 리스트 순서에 해당되는 요소를 불러온다. 리스트 순서는 0부터 시작한다. # 리스트화text="Hello, Python"list(text) #['H', 'e', 'l', 'l', 'o', ',', ' ', 'P', 'y', 't', 'h', 'o', 'n'] 문자열을 요소로 나누어 리스트화한다. int형은 list화 불가능하다. # 슬라이싱text[7:10] #Python 7에서 10까지의 요소를 불러온다. date = "20250106"year = date[0:.. 2025. 1. 16.
[Python] 연산자 기능명령어예시출력더하기+3+58빼기-5-23곱하기*3*26나누기/8/24정수나누기(정수만 나누고 소수점 버림)//3//21나머지(나누고 나머지 구하기)%8%71print("Hello World")print("Hello","World")#자동으로 두 단어 사이에 공백이 생김.print("Hello","World",sep="") #seperate를 없앰.print("010","2134","4567",sep="-") #seperate에 다른 단어를 넣음.print("Hello","Python",1,2,sep="_") #자료형이 달라도 됨(파이썬만)print() #괄호 안에 아무것도 없으면 줄바꿈 역할이 됨.print(11111) #문자열의 경우 "1111"을 넣어야하지만 숫자라서 그냥 1111넣음.print(.. 2025. 1. 16.
[VS code] VS code 단축키 (CLI 명령어) # CLI 입력 커맨드기능명령어예시현재 나의 작업위치 출력(print working directory)pwdpwd디렉토리의 위치 변경(change directory)cd 폴더명cd python현재 위치에서 모든파일/디렉토리 검색(list segements)lili현재 위치에 파일 생성하기touch 파일명.확장자touch test.txt현재 위치에서 폴더 생성하기mkdir 폴더명mkdir folder입력한 명령어 기록보기history 숫자history 10부모 폴더 의미 : ..현재 폴더 의미 : . # 전체 주석(적용할 줄 드래그 후) Ctrl+/ 2025. 1. 16.