강사님 exists와 in은 다중행 서브쿼리 작성시에 쓸수 있는 연산자라고 하셨는데, 사실 무슨 차이인지 잘 모르겠습니다.... 서브쿼리에서 존재하느냐는 exists고 in도 어떻게 보면 (존재하는)조건에 맞는 레코드를 가져오는거라서 말만 그렇지 솔직히 잘 구별하기 힘든데, 그냥 업무상에서 구분없이 써도 되나요...?
Select Case When mod(id,2) != 0 then id+1 When mod(id,2) = 0 then id-1 When id = max(id) then id-1 END as id , student From Seat Order by id 위와 같이 했는데 | id | student | | -- | ------- | | 2 | Abbot | 라는 결과를 내놓네요.
{ "compilerOptions": { "baseUrl": "src" }, "include": ["src"] } keonhongkoo@keonhongui-MacBookAir frontend % yarn start yarn run v1.22.19 $ react-scripts start node:internal/modules/cjs/loader:1325 throw err; ^ SyntaxError: /Users/keonhongkoo/Desktop/instagram/frontend/jsconfig.json: Unexpected token / in JSON at position 75 at parse (<anonymous>) at Module._extensions..json (node:internal/modules/cjs/loader:1322:39) at Module.load (node:internal/modules/cjs/loader:1117:32) at Module._load (node:internal/modules/cjs/loader:958:12) at Module.require (node:internal/modules/cjs/loader:1141:19) at require (node:internal/modules/cjs/helpers:110:18) at getModules (/Users/keonhongkoo/Desktop/instagram/frontend/node_modules/react-scripts/config/modules.js:126:14) at Object.<anonymous> (/Users/keonhongkoo/Desktop/instagram/frontend/node_modules/react-scripts/config/modules.js:142:18) at Module._compile (node:internal/modules/cjs/loader:1254:14) at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) Node.js v18.14.1 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 이렇게 결과가 출력되는데 해결책이 안보이네요... vscode도 재시작해봤습니다ㅠ
안녕하세요 M2 mac 환경입니다. mysql 및 mysql banch 설치하였고 mysql banch에서 실행 버튼만 누르면 자동으로 프로그램이 종료됩니다 ㅠ mysql 접속이 안되서 그런건가 하고 확인해보니까 mac시스템 설정에서 mysql에 들어가서 start mysql server을 클리하면 계속 start stop (초록 빨강)으로 깜빡거리는 현상도 있음을 발견햇어요 ㅠ 열심히 구글링했는데 도저히 해결책을 찾지 못해 글남겨요 ㅠ 8.0.32 arm64 설치했고요 ㅠ
사용자 입력 예외처리를 하고 있는데, 1)문자 입력 시 오류 2)3자리 숫자가 아닐 경우 오류 다음과 같이 코드를 짰는데 1)의 경우 except 부분에서 "입력 오류"를 출력하지만 2)의 경우 "입력오류"가 출력되지 않고 그냥 재입력하게 되네요. 혹시 이유를 알 수 있나요? 또한 문자 입력 시 "숫자만 입력 가능합니다"를 출력 두자리수 입력 시 "세 자리 수를 입력하세요"를 출력 하도록 하려면 코드를 어떻게 수정해야 할까요? 감사합니다.! #세 자리 숫자만 입력할 수 있게 하는 함수 def input_check(msg, casting = int): while True: try: num = input(msg) # 사용자 입력 num_str = str(num) #맨 앞의 수가 0일경우 0이 잘려버리기 때문에 str을 따로 저장 if(casting(num) and len(num) == 3): return num_str except: print("입력 오류") continue
안녕하세요 해커랭크의 Weather Observation Station 11 문제 관련 질문드리려고 합니다. 시작과 끝이 모음이 아닌 city 이름만 출력하는 문제인데요 SELECT DISTINCT CITY FROM STATION WHERE CITY REGEXP '^[^aeiou].*[^aeiou]$' [ ] 안에 ^ 표시가 포함하지 않는다는 조건이라 해당 코드로 작성했더니 정답이 아니라고 떠서 regexr 페이지에서 테스트 해봤는데 여기서는 제대로 작동하더라구요! SELECT DISTINCT CITY FROM STATION WHERE CITY NOT REGEXP '^[aeiou].*[aeiou]$' 혹시나 해서 [ ] 안 ^ 대신 REGEXP 앞에 NOT을 써보았는데 이 코드는 제대로 작동했습니다. ^조건과 NOT이 차이가 있나요??
안녕하세요~! 아나콘다를 설치하면서 두가지 정도 질문이 있습니다 1) 2023.02.22날짜로 아나콘다 최신판을 설치하는데 그림과 같이 옵션사항에 환경변수 체크가 되지 않습니다 ㅠㅠ 업데이트 되면서 바뀐것인지 아나콘다 최신판에서 이 옵션을 선택하지 않아도 괜찮을까요?? 2) 2023.02.22날짜로 아나콘다 최신판에서는 파이썬 버전이 3.9버전인데 파이썬 공식버전으로는 3.11까지 배포가 되었습니다 버전 차이가 많이 나도 아나콘다를 설치하는게 사용에 더 편리할까요??
이렇게 (N+2)*(N+2) list를 만들고 안에다가 복사해서 붙여넣어버리는 방법은 별로인가요? N = int(input()) input_list = [list(map(int, input().split())) for _ in range(N)] n_list = [[0] * (N + 2) for _ in range(N + 2)] for i in range(N): for j in range(N): n_list[i + 1][j + 1] = input_list[i][j]
소수 개수 구하기 문제 언어 : 파이썬 내용: 제가 작성한 하위 코드 for문 두 개 돌렸을뿐인데 리미트 타임에러가 뜹니다.. 구글링 해서 emurate함수 써서 푼 문제는 정답이라고 뜹니다. 난이도 초급에 emurate함수 방식으로 써서 풀라는 의도는 아니라고 판단되어 문의 드립니다. 아래 코드가 에러인지, 제가 잘 못하고 있는지 궁금합니다. (입사 전에는 자바로 면접 보고 들어갔는데 입사 한 회사에서 사용하는 언어는 파이썬이라서 파이썬으로 코테 풀고 있는점도 참고해서 피드백 부탁드립니다) received_data = int(input()) list = [] for i in range(2,received_data+1): list.append(0) for i in range(2,received_data+1): if list[i-2]==0: for j in range(2,received_data+1): if j>i and j%i==0: list[j-2]=1 print(list.count(0))
4번 bst 문제와 관련해서 아래와 같이 쿼리 했는데 틀리네요 ㅠㅠ 이유를 모르겠습니다 SELECT DISTINCT BST.N, CASE WHEN BST.P IS NULL THEN 'Root' WHEN B2.N IS NULL THEN 'Leaf' ELSE 'Inner' END FROM BST LEFT JOIN BST B2 ON BST.N = B2.P ORDER BY BST.N
이 강의에서 에러가 발생했습니다. 소스코드는 다음과 같습니다. import requests from bs4 import BeautifulSoup url = "https://www.naver.com/" response = requests.get(url) # 에러 발생한 부분 html = response.text soup = BeautifulSoup(html, 'html.parser') word = soup.select_one("#NM_set_home_btn") print(word.text) 위 코드중 response = requests.get(url) 위 부분에서 에러가 발생했습니다. [ 에러 내용 ] Max retries exceeded with url:강의에서 접속한 url 이런 에러가 나오고 Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available. 뒤에 이런 문장이 나옵니다. 에러 해결 방법은 무었인가요? [ 에러 전체 내용 ] 에러의 전체 내용은 다음과 같습니다. Exception has occurred: SSLError HTTPSConnectionPool(host='search.naver.com', port=443): Max retries exceeded with url: /search.naver?where=news&sm=tab_jum&query=%EC%82%BC%EC%84%B1%EC%A0%84%EC%9E%90 (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) urllib3.exceptions.SSLError: Can't connect to HTTPS URL because the SSL module is not available. During handling of the above exception, another exception occurred: urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='search.naver.com', port=443): Max retries exceeded with url: /search.naver?where=news&sm=tab_jum&query=%EC%82%BC%EC%84%B1%EC%A0%84%EC%9E%90 (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) During handling of the above exception, another exception occurred: File "D:\crawling\05. 뉴스 제목과 링크 가져오기.py", line 4, in <module> response = requests.get("https://search.naver.com/search.naver?where=news&sm=tab_jum&query=%EC%82%BC%EC%84%B1%EC%A0%84%EC%9E%90") requests.exceptions.SSLError: HTTPSConnectionPool(host='search.naver.com', port=443): Max retries exceeded with url: /search.naver?where=news&sm=tab_jum&query=%EC%82%BC%EC%84%B1%EC%A0%84%EC%9E%90 (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
안녕하세요. 데이터 증강 부분에 대해서 궁금점이 있어서 질문드립니다. 가지고 있는 데이터가 1000개 라고 가정했을 때, tr.Compose를 적용시키면 '기존 이미지 1000개 + 증강된 추가 이미지 개수' 가 되는건가요?? 제가 간단하게 해봤을 때는 transform 했을 때 이미지 개수 증가가 아니라 단순 이미지 변환까지만 이루어지는 것 같은데, 제가 잘못된 부분이 있는건가 좀 헷갈려서 질문 드립니다. 만약 단순 이미지 변환만 이루어지는 것이라면 이미지 개수 증가를 위해서 추가적인 작업을 진행해주어야 하는지도 궁금하네요.
안녕하세요! 해커랭크 Top Earners 문제에 관해 질문드리겠습니다. where 절에 서브쿼리를 사용할 때, select salary*months as earnings, count(*) from employee where salary*months = (select max(salary*months) from employee) 위의 코드를 작성했을때 group by 없이는 집계함수를 사용할 수 없다는 오류가 뜨는데, select count(*) from employee where salary*months = (select max(salary*months) from employee) select 에 count만 출력했을 때는 문제 없이 코드가 실행됩니다! count 단독으로 출력할 때는 전체 갯수만 파악하지만 salary*months 까지 같이 출력할 때는 해당 salary*months에 맞게 count를 해야해서 집계함수를 사용해야 하는 걸까요? 어짜피 max값만 가져와서 출력하는데도 group by를 꼭 사용해야 하는걸까요?