inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

172만명의 커뮤니티!! 함께 토론해봐요.

이렇게 코딩했더니

미해결

파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기

콘솔창에 이렇게 뜨는데 utf-8 이쪽에서 뭔가 에러가난거같은데 어떻게해야하죠? section4-1.py forecast.xml 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 import sys import io import urllib . request as req from bs4 import BeautifulSoup import os . path # os.path 내에는 경로반환, 경로추출 등 파일/디렉토리 경로와 관련된 많은 함수를 제공해준다. sys . stdout = io . TextIOWrapper ( sys . stdout . detach ( ) , encoding = ' utf-8 ' ) sys . stderr = io . TextIOWrapper ( sys . stderr . detach ( ) , encoding = ' utf-8 ' ) # 다운로드 urll url = " http://www.weather.go.kr/weather/lifenindustry/sevice_rss.jsp " savename = " c:/section4/forecast.xml " if not os . path . exists ( savename ) : req . urlretrieve ( url , savename ) # BeautifulSoup 파싱 xml = open ( savename , ' r ' , encoding = " utf-8 " ) . read ( ) soup = BeautifulSoup ( xml , ' html.parser ' ) # 지역확인 for location in soup . find_all ( " location " ) : loc = location . find ( " city " ) . string print (loc) Python - section4-1.py:26 Traceback (most recent call last): File "C:\section4\section4-1.py", line 19, in <module> xml = open(savename, 'r', encoding="utf-8").read() File "C:\Users\user\anaconda3\envs\section4\lib\codecs.py", line 321, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 118: invalid start byte [Finished in 0.152s]

  • python
  • 웹-크롤링
댓글 2 좋아요 0 조회수 373

끝자리 연산자 더하고 빼는 부분 변경을 하면

해결됨

남박사의 파이썬 기초부터 실전 100% 활용

if lop < len(user_input) : string_list.append(user_input[lop:len(user_input)]) 이렇게 lop의 값이 문자열의 길이와 다르면 그만큼 짤라서 넣으면 되지 않나요???

  • python
  • 웹-크롤링
최재영 댓글 1 좋아요 1 조회수 290

구글에서 온 메일

미해결

[개정판] 딥러닝 컴퓨터 비전 완벽 가이드

Hello, We have received your quota request for smiling-parser-275018. Unfortunately, we are unable to grant you additional quota at this time. If this is a new project please wait 48h until you resubmit the request or until your Billing account has additional history. Your Sales Rep is a good Escalation Path for these requests, and we highly recommend you to reach out to them. If you have any further questions, please reply to this thread or feel free to reach out to us at gc-team@google.com . Thanks. gpu서버 할당받으려고 메일을 보냈는데 48시간을 기다리는 말인가요?ㅠ

  • tensorflow
  • 딥러닝
  • python
  • keras
  • 머신러닝 배워볼래요?
  • 컴퓨터-비전
댓글 17 좋아요 0 조회수 1048

User.js 에서 this

미해결

따라하며 배우는 노드, 리액트 시리즈 - 기본 강의

userSchema.pre("save", function (next) { var user = this; if (user.isModified("password")) { bcrypt.genSalt(saltRounds, function (err, salt) { ... var user = this 를 하면 user 에는 뭐가 담기게 되는거죠?ㅠㅠ 또 여기서 var user = this 를 선언을 했는데 userSchema.methods.generateToken = function (callback) { var user = this; var token = jwt.sign(user._id.toHexString(), "secretToken"); ... 왜 여기서 또 선언을 하는 거에요? User.js 에서 user 이라는 변수가 뭔지 정확히 모르겠습니다ㅠㅠ

  • react
  • nodejs
JADE CHO (SUEMIN) 댓글 1 좋아요 0 조회수 229

제 질문 지나서 답변하셔서 다시 질문드립니다.

미해결

인스타그램 클론 - full stack 웹 개발

마지막 완성된 페이지를 구동시켜보고 싶습니다. 최소한으로 필요한 세팅과 다운해야하는 첨부파일을 정리해서 알려주세요! 완성된 페이지를 통해 작동하는 원리를 배우면서 하고 싶습니다. 해당 강의 번호 및 페이지를 작동시키는 순서 알려주시면 감사하겠습니다.

  • 클론코딩
  • python
  • HTML/CSS
  • django
댓글 1 좋아요 1 조회수 197

직접 따라하기 전에 완성된 페이지 구동시켜보고 싶습니다.

미해결

페이스북 클론 - full stack 웹 개발

마지막 완성된 페이지를 구동시켜보고 싶습니다. 최소한으로 필요한 세팅과 다운해야하는 첨부파일을 정리해서 알려주세요! 완성된 페이지를 통해 작동하는 원리를 배우면서 하고 싶습니다. 해당 강의 번호 및 페이지를 작동시키는 순서 알려주시면 감사하겠습니다.

  • django
  • python
  • linux
  • javascript
  • HTML/CSS
  • 클론코딩
댓글 1 좋아요 3 조회수 206

lmplot 회귀선이 안나타나요

미해결

공공데이터로 파이썬 데이터 분석 시작하기

강사님이 하시는대로 따라서 했는데 lmplot 사용할 때 회귀선이 안나타납니다...

  • pandas
  • python
  • numpy
이민형 댓글 9 좋아요 6 조회수 930

함수의 원형

해결됨

[개정판] 파이썬 머신러닝 완벽 가이드

안녕하세요. 판다스(Pandas) 개요와 기본 API - 01 편에서 9분24초에 나오는 부분에 대한 질문입니다. 영상에서 함수의 원형이라고 말씀 하시면서 함수에 쓸수 있는 옵션을 전부 보여 주셨는데요. 어떻게 하면 그렇게 함수의 쓸 수 있는 옵션을 볼 수 있는지 궁금 합니다. 그리고 그것을 볼 수 있는 단축키 같은 것도 존재 한다면 알려 주세요. 감사합니다.

  • 머신러닝 배워볼래요?
  • python
  • 통계
맷수달 댓글 2 좋아요 0 조회수 200

안녕하세요.

해결됨

따라하며 배우는 노드, 리액트 시리즈 - 기본 강의

추가적으로 궁금한점이 있어서 이렇게 남깁니다. 로그아웃 버튼을 클릭하면 mongoDB에 token이 "" 사라지게 구현해놓으셨는데, ie에서 application > cookies에서는 아직 token이 계속 있더라구요.. 상관이 없을까요?

  • nodejs
  • react
Byeong Mok Jang 댓글 2 좋아요 0 조회수 206

파일필터

해결됨

따라하며 배우는 노드, 리액트 시리즈 - 유튜브 사이트 만들기

파일필터 정상작동여부 판단을 위해서 mp4가 아닌 png를 올려보앗는데 업로드폴더에 들어갑니다 ㅠㅠ

  • react
  • nodejs
  • mongodb
  • redux
유용석 댓글 4 좋아요 0 조회수 363

postman에서 계속 로딩 뜨시는 분들

미해결

따라하며 배우는 노드, 리액트 시리즈 - 기본 강의

저도 postman에서 계속 로딩만 뜨길래 오타났나 계속 찾다가, 강사님 답변 보고 해결해서 여기에 글 남겨요. /User.js 파일 에서 userSchema.methods.comparePassword 구문 안 bcrypt.compare 안에 있는 if문 수정하시면 잘 됩니다. if(err) return cb(err); // 맨 끝에 ,(콤마)아니고 ;(세미콜론)으로 해주셔야 합니다! cb(null,isMatch);

  • react
  • nodejs
ycg02116 댓글 16 좋아요 38 조회수 1159

script 과 autocomplete-python

미해결

프로그래밍, 데이터 과학을 위한 파이썬 입문

이 검색해도 패키지로 안나오는데요 어떻게 해야하나요

  • bigdata
  • python
댓글 1 좋아요 0 조회수 273

TypeError: Cannot read property 'prototype' of undefined

미해결

따라하며 배우는 노드, 리액트 시리즈 - 기본 강의

https://github.com/ryun3433/inf-todo.git 깃헙주소입니다. 이런 에러가 계속 납니다 ㅠ.ㅠ 뭐가 문제인지 잘 모르겠습니다.. 도와주시면 정말 감사하겠습니다 TypeError: Cannot read property 'prototype' of undefined (anonymous function) C:/Users/patmo/Documents/myProject/inf-todo/client/node_modules/express/lib/response.js:42 39 | * @ public var res = Object . create ( http . ServerResponse . prototype )

  • react
  • nodejs
릴롱궤 댓글 4 좋아요 3 조회수 4502

도와주세요...

미해결

따라하며 배우는 노드, 리액트 시리즈 - 기본 강의

계속 붙잡고 있어도 안되서 헬프를 칩니다.. 뭐가 문제인거죠..? auth.js 파일에서 findbytoken을 만드는데 계속 안되기만 합니다. TypeError: User.findByTokenis not a function at auth (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\middleware\auth.js:8:10) at Layer.handle [as handle_request] (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\layer.js:95:5) at next (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\layer.js:95:5) at C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:281:22 at Function.process_params (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:275:10) at cookieParser (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\cookie-parser\index.js:71:5) at Layer.handle [as handle_request] (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:317:13) at C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:275:10) at C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\body-parser\lib\read.js:130:5 at invokeCallback (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\raw-body\index.js:224:16) ㄱ계속 이 문구만 뜨고요 함수가 아니라는데 저는 함수를 user.js에 만들었고.. 아 이게 무슨 문제일까요.. auth.js const { User } = require ( '../models/user' ); let auth = ( req , res , next ) => { // 이곳에서 인증처리를 하는 곳 // 클라이언트 쿠리에서 토큰을 가져온다 ==> 쿠키 파서를 이용한다. let token = req . cookies . x_auth ; console . log ( 'auth/token :' + token ); // 토큰을 복호화한 후 유저를 찾는다. User . findByToken ( token , ( err , user ) => { if ( err ) throw err ; if (! user ) { return res . json ({ isAuth : false , error : true }) // 유저가 없으니까 } else { // 유저가 있으면 req . token = token ; // 이렇게 설정해주는 이유는 콜러에서 req.token , req.user와 같이 사용할 수 있게 하기 위해서이다. req . user = user ; next (); } }); // 유저가 있으면 인증 오케이 // 유저가 없으면 인증 노노 } module . exports = { auth }; user.js const mongoose = require ( '../node_modules/mongoose' ); const bcrypt = require ( 'bcrypt' ); const saltRounds = 10 ; const myPlaintextPassword = 's0/ \/\P 4$$w0rD' ; const someOtherPlaintextPassword = 'not_bacon' ; var jwt = require ( 'jsonwebtoken' ); const userSchema = mongoose . Schema ({ name : { type : String , maxlength : 50 }, email : { type : String , trim : true , //스페이스를 없앤다 unique : 1 // 유일한 특성 }, password : { type : String , minlength : 5 }, lastname : { type : String , maxlength : 50 }, role : { // 롤을 주는 이유는 유저의 관리권한을 부여하기 위해서 type : Number , defalut : 0 }, image : String , token : { // 토큰을 이용해서 유효성등을 나중에 관리함 type : String }, tokenExp : { // 토큰의 유효기간 type : Number } }) userSchema . pre ( 'save' , function ( next ) { var user = this ; console . log ( '1' ); if ( user . isModified ( 'password' )) { console . log ( '2' ); bcrypt . genSalt ( saltRounds , function ( err , salt ) { console . log ( '3' ); if ( err ) return next ( err ); console . log ( '4' ); bcrypt . hash ( user . password , salt , function ( err , hash ) { console . log ( '5' ); if ( err ) return next ( err ); console . log ( '6' ); console . log ( hash ); user . password = hash ; next (); }); }); } else { next (); } }) userSchema . methods . comparePassword = function ( planPassword , cb ){ bcrypt . compare ( planPassword , this . password , function ( err , isMatch ){ if ( err ) return cb ( err ); cb ( null , isMatch ); } ); } userSchema . methods . generateToken = function ( cb ){ var user = this ; // json웹토큰을 이용해서 토큰을 생성하기 var token = jwt . sign ( user . _id . toHexString (), 'hihello' ); // 이렇게 토큰을 만들면 ,, // user._id + hihello = token이 되고, 나중에는 token과 hihello로 user._id를 만들 수 있다. user . token = token ; user . save ( function ( err , user ){ if ( err ) return cb ( err ); // 에러가 났으면 에러를 전달 cb ( null , user ); // 문제가 없으면 에러는 없고 유저를 전달 자 그럼 index.js로 넘어가서~ }); } userSchema . methods . B = function ( token , cb ){} userSchema . methods . findByToken = function ( token , cb ){ var user = this ; // 토큰을 디코드 한다. user_id + '' = token console . log ( "1 : " + token ); jwt . verify ( token , 'hihello' , function ( err , decoded ){ // 유저 아이디를 이용해서 유저를 찾은 다음에 // 클라이언트에서 가져온 token과 db에 보관된 토큰이 일치하는지 확인 user . findOne ({ "_id" : decoded , "token" : token }, function ( err , user ){ if ( err ){ return cb ( err ); } else { cb ( null , user ); } }) }) } const User = mongoose . model ( 'User' , userSchema ); console . log ( User . comparePassword ); module . exports = { User }; 좋은 강의 항상 감사드립니다.

  • nodejs
  • react
andrewlee 댓글 7 좋아요 2 조회수 889

머신러닝 속도 높이는 방법

해결됨

[개정판] 파이썬 머신러닝 완벽 가이드

안녕하세요? 저는 이제 막 머신러닝에 관심을 갖고 공부를 시작했습니다. 한 가지 궁금한 점은 저의 경우 100만개 정도 데이터로 머신러닝을 수행하는 경우도 있을 것으로 예상하는 데 머신러닝 속도를 높이는 방법이 궁금합니다. 배워도 속도 때문에 활용도가 낮아질까 염려되어 미리 질문 드립니다. 좋은 강의 감사합니다.

  • 통계
  • 머신러닝 배워볼래요?
  • python
Neo 댓글 2 좋아요 0 조회수 4542

인기 태그

인프런 TOP Writers

주간 인기글