묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기
크롤링이 안됩니다 ㅠ
선생님,안녕하세요. 가르쳐 ^^;; 주신대로 여러 한국 사이트를 크롤링해보니 참 잘되서 고맙습니다.아래 MLB사이트도 한번 크롤링해볼려고 하는데 여러가지로 해봐도 안끌어와서요.혹시 이유가 좀 있을까요?from bs4 import BeautifulSoupimport urllib.request as reqimport sysimport iosys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding = 'utf-8')sys.stderr = io.TextIOWrapper(sys.stderr.detach(), encoding = 'utf-8')url = "http://mlb.mlb.com/stats/sortable.jsp#elem=%5Bobject+Object%5D&tab_level=child&click_text=Sortable+Player+hitting&game_type='R'&season=2018&season_type=ANY&league_code='MLB'§ionType=sp&statType=hitting&page=1&ts=1525019114922"contents = req.urlopen(url).read()soup = BeautifulSoup(contents, "html.parser")filter_contents = soup.select("#datagrid > tr")print(filter_contents)
-
미해결테스트주도개발(TDD)로 만드는 NodeJS API 서버
에러가 발생합니다..
안녕하세요, 코드는 동일한데.. 아래와 같은 에러가 등장합니다.어떤 것이 문제 일까요?환경은 웹스톰 입니다!/usr/local/bin/node --inspect-brk=58575 /Users/juno/IdeaProjects/WebstormProjects/node-modeluer/express_index.jsDebugger listening on ws://127.0.0.1:58575/defc4bde-ef4f-4bc8-84b7-04624b59c3f6For help see https://nodejs.org/en/docs/inspectorDebugger attached.commonmw/Users/juno/IdeaProjects/WebstormProjects/node-modeluer/express_index.js:9next(new Error('error ouccered'));^TypeError: next is not a functionat commonMW (/Users/juno/IdeaProjects/WebstormProjects/node-modeluer/express_index.js:9:5)at Object. (/Users/juno/IdeaProjects/WebstormProjects/node-modeluer/express_index.js:27:9)at Module._compile (internal/modules/cjs/loader.js:651:14)at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)at Module.load (internal/modules/cjs/loader.js:566:32)at tryModuleLoad (internal/modules/cjs/loader.js:506:12)at Function.Module._load (internal/modules/cjs/loader.js:498:3)at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)at startup (internal/bootstrap/node.js:201:19)at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)Waiting for the debugger to disconnect...Process finished with exit code 1
-
미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
yesterday.txt 파일 주소가 404 Not Found로 나옵니다
(사진)
-
미해결유니티 게임 개발 (2D) 실전편 - 스크립트는 물론, 디자인 패턴과 알고리즘까지
생성자? 함수에 대한 설명을 해주셨으면 합니다.
딕셔너리 영상에서 생성자 함수라는 개념이 나왔는데 자세한 설명없이 대충 넘어가서 이해가 안됩니다. 이 부분에 대해 설명 좀 부탁드립니다. StatData라는 class를 따로 만들어야되는 이유도 궁금합니다. public class StatData { public int hp, mp; public StatData(int _hp, int _mp) { this.hp = _hp; this.mp = _mp; } }
-
미해결밑바닥 부터 시작하는 머신러닝 입문
news_data를 받을 수 없을까요?
제가 '밑바닥 부터 시작하는 머신러닝 입문'만 수강중이고, '데이터 과학을 위한 파이썬 입문'는 수강을 하고 있지 않아서 news_data를 받을 수가 없습니다.혹시 news_data만 따로 받을 수 있는 방법이 없을까요?
-
미해결유니티 게임 개발 (2D) 실전편 - 스크립트는 물론, 디자인 패턴과 알고리즘까지
싱글톤 추가 강의는 언제쯤 올라올까요?
싱글톤 영상 마지막에 싱글톤 추가 강의를 올려주신다고 되있는데 언제 올라오는지 궁금합니다.답변 부탁드립니다.
-
미해결밑바닥 부터 시작하는 머신러닝 입문
정규표현식 중 이해가 되지 않는 표현이 있습니다.
안녕하세요. 좋은 강의 항상 감사드립니다. data_cleansing()에서 숫자를 삭제하기 위해서 사용한 r'\b|\d+|\b'이 정확히 어떠한 문자열을 목표로 하고 있는지 잘 모르겠습니다. '|'는 or이라고 알고 있는데, 그냥 해석하면 word boundry OR digits OR word boundry 인데 or랑 word boundry가 같이 있으니 정확한 의미 파악이 안됩니다. 혹시 r'\b\d+\b'의 오타인가요?
-
미해결테스트주도개발(TDD)로 만드는 NodeJS API 서버
syncDB().then 이후 콜백함수의 파라미터로 언더바가 들어가는건 뭔가요?
처음 보는 문법이네요 ^^
-
미해결C++ Let's Make Games
동영상 재생이 안되요
동영상 재생이 안됩니다. 확인해주시면 정말 감사하겠습니다.
-
미해결밑바닥 부터 시작하는 머신러닝 입문
Smoothing 과 Log 연산을 사용했을 때 다른 결과가 나옵니다.
안녕하세요.강의 잘 듣고 있습니다.2_german_credit_application 따라하다가 Smoothing과 log를 적용해 보았는데,결과가 원래와 다르게 나옵니다.아래 코드입니다. 혹시 제가 실수한 곳이 있나요.몇 시간이나 이것 저것 바꾸어 보았지만 찾지 못해서 질문드립니다.고맙습니다.import pandas as pdimport numpy as npdf = pd.read_csv('./fraud.csv', sep=',')del df['ID']y_data = df['Fraud'].as_matrix()x_df = pd.get_dummies(df[['History', 'CoApplicant', 'Accommodation']])x_data = x_df.as_matrix()ix_y_is_true = np.where(y_data == True)[0]ix_y_is_false = np.where(y_data == False)[0]p_y_is_true = len(ix_y_is_true) / len(y_data)p_y_is_false = len(ix_y_is_false)/ len(y_data)# Smoothing...k = 2p_x_when_y_is_true_sm = (np.sum(x_data[ix_y_is_true], axis=0) + k) / (len(ix_y_is_true) + k * 2)p_x_when_y_is_false_sm = (np.sum(x_data[ix_y_is_false], axis=0) + k) / (len(ix_y_is_false) + k * 2)# Testx_test = [0,1,0,0,0,1,0, 0,1,0]p_true = np.log(p_y_is_true) + np.dot(x_test, np.log(p_x_when_y_is_true_sm))p_false = np.log(p_y_is_false) + np.dot(x_test, np.log(p_x_when_y_is_false_sm))print('p_true > p_false :', p_true > p_false)
-
미해결파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기
에러가 계속 나서 글을 남깁니다.
선생님, 안녕하세요?저는 postgresql을 써서요. 그래도 하기와 같이 하면 되야하는데 같은 'psycopg2' 관련해서 계속 에러가 떠서요. 구글 찾아 가이드대로 깔아도 잘 안되는데 도와주십시요 ㅠ. 사실 pip install psycopg2하면 "Requirement already satisfied: psycopg2 in c:usersminanaconda3libsite-packages" 뜨기는 하거든요. 4시간을 헤메다가 ㅠ 글남깁니다.----소스코드----from sqlalchemy import create_engineengine = create_engine('postgresql://postgres:@비번@localhost/digitalclass')----에러메시지----Traceback (most recent call last):File "C:UsersminDownloadstest.py", line 4, in engine = create_engine('postgresql://postgres:@OPtimus7624@localhost/digitalclass')File "C:UsersminAnaconda3envsdigitalhw1libsite-packagessqlalchemyengineinit.py", line 424, in create_enginereturn strategy.create(*args, kwargs)File "C:UsersminAnaconda3envsdigitalhw1libsite-packagessqlalchemyenginestrategies.py", line 81, in createdbapi = dialect_cls.dbapi(dbapi_args)File "C:UsersminAnaconda3envsdigitalhw1libsite-packagessqlalchemydialectspostgresqlpsycopg2.py", line 584, in dbapiimport psycopg2File "C:UsersminAnaconda3envsdigitalhw1libsite-packagespsycopg2-2.6.2-py3.4-win-amd64.eggpsycopg2init.py", line 50, in from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWIDImportError: No module named 'psycopg2._psycopg
-
미해결직장인을 위한 프로그래밍 입문과 업무자동화 활용
seperated -> separated ^^
강사님~ 강의 잘 듣고 있습니다.스펠링이 "separate"가 맞습니다 ^^
-
미해결신입 프로그래머를 위한 실전 JSP 강좌
잘들었습니다~!
이번 강의부터 타블렛을 쓰시기 시작한듯요~! 훨씬 보기 좋습니다.
-
미해결신입 프로그래머를 위한 실전 JSP 강좌
ServletListener 클래스 생성시 오버라이드 생성 안되는 현상
강사님께서 올려주신 동영상에는 클래스 생성시에 오버라이드가 자동적으로 함께 생성되는데 제가 할때는 안되네요 ㅠㅠ 조금 다른 개발환경이라 그런걸까요?jdk 1.8.0_171tomcat 9.0.7Eclipse Oxygen.3a 사용중입니다. (처음 자바 10 깔아쓸 때에는 톰캣조차 안되어 한참 삽질도 했었어요;)
-
미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
코드가 아니고 파일에 문제가있어 과제제출이 안됩니다
python-kernel: skipping build phase due to missing "setup.py" file✔ Build finished.Traceback (most recent call last):File "test.py", line 67, in exec(test_code, test_module.dict)File "", line 5, in File "/home/work/gowithflow.py", line 262import collections import OrderedDict^SyntaxError: invalid syntax라며 과제제출 자체가 야예 안되는건 왜 그럴까요 선생님?
-
미해결테스트주도개발(TDD)로 만드는 NodeJS API 서버
테스트 과정에서 before all 이라는 에러가 뜹니다.
before all hook 이라는 에러문구가 뜨는데 이게 무었인지 잘모르겠습니다.
-
미해결파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기
예외처리시 try를 쓴다음에 except문을 반드시 안써주어도 되나요.
안녕하세요궁금한게요 예외처리시 사용하는 try문 같은경우 아래쪽에 except를 써주어야 되는것으로 알고있는데요반드시 써주어야 하는건 아닌간요? 안써주어도 무방하나요?감사합니다
-
미해결C 프로그래밍 - 입문부터 게임 개발까지
선생님...!!!
include include int getRandomNumber(int level);void showQuestion(int level, int num1, int num2);void success()void fail()int main(void){//문이 5개, 각 문제마다 점점 어려운 수식 퀴즈 출제(랜덤)//맞히면 통과, 틀리면 실패srand(time(NULL));int count = 0;for (int i = 1; i <= 5; i++){ int num1 = getRandomNumber(i); int num2 = getRandomNumber(i); //printf("%d X %d ? ", num1, num2); showQuestion(i, num1, num2); int answer = -1; scanf_s("%d", &answer); if (answer == -1) { printf("프로그램을 종료합니다.\n"); break; } else if (answer == num1 + num2) { success(); count++; } else { fail(); }}printf("\n\n 당신은 5개의 비밀번호 중 %d 개를 맞혔습니다.\n", count);return 0;}int getRandomNumber(int level){return rand() % (level * 7) + 1;}void showQuestion(int level, int num1, int num2){printf("nnn########## %d 번째 비밀번호 ##########", level);printf("nt %d X %d 는?nn", num1, num2);printf("######################################n");printf("n비밀번호를 입력하세요 (종료 : -1) >>");}void success(){printf("n >> Good ! 정답입니다!n");}void fail(){printf("n >> 땡! 틀렸습니다.n");}이렇게 코딩을 했는데... 에러가 나와요... fail에 여기서 선언이 매개 변수를 선언해야 한다고하고int main(void) 에서는 ;가 필요하다고 나오고...return 0; 에서는 {가 필요하다고 하네요...ㅠㅠVS 평가판 끝났다고 해서 2017말고 예전에 15쓰던거 쓰고있기는 한데... 도와주세요 ㅠㅠ
-
미해결웹, 앱 풀스택개발 Boot Camp - 입문부터 서비스 개발까지
실행이 안되네요.
구름IDE에서 github에서 소스를 Clone 해서 하고 있습니다. 그런데 하라는 데로 다 했는데 실행이 안되네요. 아래처럼 메시지가 나오는데, 어떻게 해야 하나요? 루비나 레일즈 이런것들이 버전이 안맞아서 그런가요? root@goorm:/workspace/inflearn-rorproject-# cd /workspace/inflearn-rorproject- && rails s -b 0.0.0.0 -p 3000 /usr/local/rvm/gems/ruby-2.4.0/gems/thread_safe-0.3.5/lib/thread_safe/cache.rb:155: warning: constant ::Fixnum is deprecated => Booting WEBrick => Rails 4.2.5 application starting in development on http://0.0.0.0:3000 => Run`rails server -h`for more startup options => Ctrl-C to shutdown server /usr/local/rvm/gems/ruby-2.4.0/gems/thread_safe-0.3.5/lib/thread_safe/cache.rb:155: warning: constant ::Fixnum is deprecated /usr/local/rvm/gems/ruby-2.4.0/gems/thread_safe-0.3.5/lib/thread_safe/cache.rb:155: warning: constant ::Fixnum is deprecated /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated Exiting /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:124:in`block (2 levels) in ': stack level too deep (SystemStackError) from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in`block (2 levels) in ' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in`block (2 levels) in ' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in`block (2 levels) in ' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>' from /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in`block (2 levels) in ' ... 5013 levels... from /workspace/inflearn-rorproject-/bin/spring:15:in `require' from /workspace/inflearn-rorproject-/bin/spring:15:in`<top (required)>' from bin/rails:3:in `load' from bin/rails:3:in`'
-
미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
hydrogen 2.4.1 사용시 오류 발생합니다. 어떻게 설정해야 하나요?
저는 윈도우7 사용자입니다. import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) plt.ylabel('some numbers') plt.show() ModuleNotFoundError Traceback (most recent call last) in () ----> 1 import matplotlib.pyplot as plt 2 3 plt.plot([1, 2, 3, 4]) 4 plt.ylabel('some numbers') 5 plt.show() ModuleNotFoundError: No module named 'matplotlib'