inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

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

설치 오류

해결됨

챗GPT와 파이썬으로 주식 자동매매 앱 및 웹 투자 리포트 만들기

아나콘다 프롬프트에서 파이썬 정상 설치 후 platform 입력 시 syntax error 가 뜹니다 ㅠ

  • python
  • 재테크
  • streamlit
  • chatgpt
  • 프롬프트엔지니어링
정동학 댓글 1 좋아요 0 조회수 262

getter메소드에 락관리

해결됨

김영한의 실전 자바 - 고급 1편, 멀티스레드와 동시성

3:05에서 getBalance()에서 계속 동시성 관리를 하는 이유가 메모리가시화 문제 때문인가요? 만약 그런거라면 앞으로 멀티스레드환경에 노출된 인스턴스변수들은 단순 반환만하는 getter메소드에서도 무조건 volitile이나 락관리를 해야되는게 맞을까요?

  • java
  • 객체지향
  • 동시성
  • multithread
  • thread
인프런 댓글 1 좋아요 2 조회수 366

비쥬얼 스튜디오에서는 되는데 명령 프롬포트에선 실행되지 않습니다

미해결

프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)

프롬포트 C:\>C:\infrun\qwer\python1.0_source\source_code\chapter10_ 011.py what is your nameiys hi iys time to play hangman man start loading Traceback (most recent call last): File "C:\infrun\qwer\python1.0_source\source_code\chapter10_011.py", line 21, in <module> with open('source_code/resource/word_list.csv','r') as f: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'source_code/resource/word_list.csv' 비쥬얼 스튜디오 import time import csv import random import winsound name = input('what is your name') print('hi',name,'time to play hangman man') print() time.sleep(1) print('start loading') print() time.sleep(0.5) words=[] with open('source_code/resource/word_list.csv','r') as f: reader = csv.reader(f) next(reader) for c in reader: words.append(c) random.shuffle(words) q = random.choice(words) words=q[0].strip()

  • python
sukim13062 댓글 1 좋아요 0 조회수 126

2차원 dp 11:45분에서 하상좌우 순서에 의미가 있나요?

해결됨

2주만에 통과하는 알고리즘 코딩테스트 (2024년)

상하좌우 순서 고쳐주셨다고 하셔서 그냥 순서 바꿔서 해봤더니 값이 다르게 나오네요.. 이해가 안됩니다 센세 ㅠㅠ흑흑

  • python
  • 코딩-테스트
  • 알고리즘
shinmj8721@naver.com 댓글 2 좋아요 1 조회수 220

LockSupport.park()의 isInterrupted() 질문

미해결

김영한의 실전 자바 - 고급 1편, 멀티스레드와 동시성

안녕하세요. 김영한님의 강의 잘 보고 있습니다. 바보 같은 질문일 수 있지만, Thread.sleep()과는 다르게 LockSupport.park()는 interrupt()를 이용해서 깨어나도 isInterrupted()가 true인 이유가 궁금합니다. 그냥 단순히 InterruptedException이 발생하지 않기 때문일까요?

  • java
  • 객체지향
  • 동시성
  • multithread
  • thread
강동현 댓글 1 좋아요 0 조회수 351

pycharm setting에서 질문 드려요.

미해결

웹크롤링 with 파이썬

안녕하세요? pycharm 세팅에서 python interpreter 설정 시 설정한 패키지가 보이지 않아서요ㅠㅡㅠ 여러번 다시 따라했는데 안되는데 방법이 있을까요?ㅜ.ㅜ

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

공부 방법

미해결

파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)

-안녕하세요 선생님 강의 잘 듣고 있습니다. 제가 구현이 너무 안되어서....이 강의를 듣게 되었습니다..혼자 코드업 문제 등을 풀어보면 해결이 안되는 문제는 몇일씩 고민해도 시간만 가고 해결이 안되더라구요... 그래서 방법을 한번 바꿔볼까 해서 이 강의를 듣게 되었어요.. 선생님 강의를 전체 한번 쭉 다 듣고 다시 개인적으로 공부하는 방법이 어떤가 싶어 문의드립니다.. 알고리즘을 떠올리기가 힘듭니다...ㅜ 지금 DFS문제부터 듣고 있습니다.. 뒷 부분 강의부터 먼저 접해보면 앞부분의 문제는 좀더 쉽게 해결되지 않을까 해서요....;; 공부 방법에 대해 선생님께 조언을 좀 구하고저 합니다... 작성된 코드는 대부분 다 이해를 합니다..구현이 너무나 어렵습니다....ㅠㅠ 조언 부탁드립니다..

  • python
  • 코딩-테스트
red71004 댓글 1 좋아요 0 조회수 183

this 질문

해결됨

김영한의 실전 자바 - 고급 1편, 멀티스레드와 동시성

그러면 main 메소드 내에 Thread thread1 = new Thread(..); Thread thread2 = new Thread(..); 이걸 실행하면 main 스택프레임내에 참조변수가 저장이될텐데 thread1,thread2가 아닌 this로 저장된다는건가요? 그러면 예를들어, 참조변수 a의 메소드를 실행하게된다면 먼저 스택프레임내에서 참조변수에서 실제 인스턴스가 저장된 힙 주소를 꺼내어서 그 힙주소로 간다음 메소드를 가져오는게 아니라 참조변수 a가 아닌 this 인거죠?

  • java
  • 객체지향
  • 동시성
  • multithread
  • thread
인프런 댓글 1 좋아요 0 조회수 360

실습문제 14 관련 문의

미해결

[신규 개정판] 코딩 입문자를 위한 파이썬 완벽가이드

안녕하세요 실습문제 풀어보다가 질문이 생겨서 남깁니다! 해당 문제인 경우는 팀원의 수가 적어서 3이라는 숫자로 적어서 나누는게 가능했지만, 만약 팀원의 수가 굉장히 많다면 해당 함수는 쓰기 어려워질까요? (어차피 매개변수에 그만큼 나열해야하니 효율성문제로) sql과 달리 avg라는 연산자가 없는 것 같아서요! 또한 int를 적용하지 않았는데 덧셈연산자가 작동한 이유를 알고 싶습니다! 어렴풋하게만 느낌이 와서 정확히 알고 싶습니다.

  • python
dmsal0544 댓글 2 좋아요 0 조회수 159

타임시리즈 데이터 가져오기에서 에러원인이 무엇인가요?

해결됨

파이썬 알고리즘 트레이딩 파트2: Interactive Brokers API를 활용한 실시간 알고리즘 트레이딩

stock-trading-eda-scheduled.ipynb 파일에서 데이트 타임을 당겨오면 아래와 같은 에러메세지가 출력됩니다. 어떤 현상인가요?

  • python
  • 객체지향
  • 퀀트
chopa111 댓글 2 좋아요 0 조회수 239

스레드와 메모리영역 질문

해결됨

김영한의 실전 자바 - 고급 1편, 멀티스레드와 동시성

1:31 경에 쓰레드1,2,3 3개의 객체를 만들고 실행하잖아요 그러면 1:49 그림에서 3개의 인스턴스가 그려져야하는거 아닌가요? 반복문을 통해 Thread를 100개 실행하고 있습니다. 여기서, thread 참조변수에 Thread 객체를 생성하고 있던데, 그렇다면 for문 순회하나하고 블록 종료시점에 스택프레임이 제거되어 thread 참조변수는 제거될것이고 힙영역에 Thread 객체가 존재하다가 나중에 GC 실행시점에 Thread 객체가 지워질것으로 보이는데 맞나요? 만약 그렇게 Thread 객체가 지워진다면 실행중이던 스레드도 중단되나요?

  • java
  • 객체지향
  • 동시성
  • multithread
  • thread
인프런 댓글 1 좋아요 0 조회수 328

보스턴 집값 예측 15번 강의에 쓰이는 csv

해결됨

파이썬으로 시작하는 머신러닝+딥러닝(sklearn을 이용한 머신러닝부터 TensorFlow, Keras를 이용한 딥러닝 개발까지)

보스턴 집값 예측 15번 강의에 쓰이는 csv는 어디서에서 다운받는지요?

  • python
  • 머신러닝
  • 딥러닝
  • keras
  • sklearn
dekman 댓글 1 좋아요 2 조회수 258

메서드 영역에 static 변수?

해결됨

김영한의 실전 자바 - 고급 1편, 멀티스레드와 동시성

자바 8부터 Heap 영역에 Static Object(Static Variable, static객체 , static method)이 존재하고 MetaSpace에는 static reference만 저장한다고 아래 글에서 읽었습니다. https://openjdk.org/jeps/122 어떤게 맞는건가요? 제가 오역한거같지는 않은게 다른 분들도 그렇게 말씀하시는것 같습니다. https://jgrammer.tistory.com/entry/JAVA-Java8%EB%B6%80%ED%84%B0%EB%8A%94-static%EC%9D%B4-heap%EC%98%81%EC%97%AD%EC%97%90-%EC%A0%80%EC%9E%A5%EB%90%9C%EB%8B%A4

  • java
  • 객체지향
  • 동시성
  • multithread
  • thread
인프런 댓글 1 좋아요 1 조회수 451

기본 3강부터 막혀 멍청해서 화가납니다 ㅠㅠ

해결됨

2주만에 통과하는 알고리즘 코딩테스트 (2024년)

제곱수의 합문제요.. 6일 경우 제곱이 되려면 루트6밖에 안되는데 왜 2가 2로 떨어지는 약수의 개수로 카운팅되는지 이해를 못하겠네요… 또 3의 제곱 5의 제곱은 왜 고려안하는지도… ( 이미 이해 다 됐다고 가정해서 말씀하신건지도 모르겠습니다.ㅠㅠ ) 바보도 알고리즘 천재로 만들어주신다고 들어서 잘 알려주시면 감사드리겠습니다 ㅠㅠ

  • python
  • 코딩-테스트
  • 알고리즘
0S 댓글 2 좋아요 1 조회수 519

동적 의존성 주입과 Volatile

미해결

김영한의 실전 자바 - 고급 1편, 멀티스레드와 동시성

[질문] 2024.08.07 까지는 정액할인, 2024.08.08 부터는 비율할인 정책이 반영되어야 하는 비즈니스 로직이 있고, 이를 스케줄러를 활용하여 2024.08.08 00:00:00에 Setter를 활용하여 비율할인을 구현한 Bean을 Injection 하여 처리하도록 구현했다고 가정하면, 이런 경우에도 아주 아주 엄밀하게 00:00:00에 모든 할인 정책이 완벽히 적용되어야 한다면, 인스턴스 변수에 volatile을 반드시 명시해줘야 하는 것인가요? 경험이 미천하여 웹프로그래밍 할 때 volatile를 사용한 것을 거의 보지 못하였고, 위의 가정처럼 아주 엄밀한 동작을 요구하는 경우는 없었고 그간 별다른 일도 없긴 하였는데, 개념을 듣고 복기해보니 장애의 요인이 될 수 있을 것 같아 여쭙습니다.

  • java
  • 객체지향
  • 동시성
  • multithread
  • thread
김경민 댓글 1 좋아요 0 조회수 225

안녕하세요. 강사님께서 제공해주신 코드로 다른 문제를 풀려고 합니다.

해결됨

세계 대회 진출자가 알려주는 코딩테스트 A to Z (with Python)

안녕하세요. 강사님께서 제공해주신 이분탐색 1번 2번 코드중 2번 코드로 새로운 문제를 풀려고 합니다. 1번 코드(left와 right 설정)으로는 잘 풀리는데 2번 코드(cur과 step 설정)로는 잘 안풀리네요. 백준 2343번 기타문제를 강사님께서 제공해주신 코드로 풀려고 아래와 같이 코드를 짜보았습니다. 하지만 원하는 결과를 얻지 못했는데요. 어떤 부분이 잘못된건지 알려주실 수 있을까요?? nums, blue_nums = map(int, input().split()) bluelay_length = list(map(int, input().split())) def check(length): count = 1 current_length = 0 for i in bluelay_length: if current_length + i <= length: current_length += i else: current_length = i count += 1 return count == blue_nums cur = 0 steps = 10000+1 while steps > 0: while cur + steps <= 10000+1 and check(cur + steps): cur += steps steps //= 2 print(cur) 감사합니다.

  • python
  • 코딩-테스트
  • 알고리즘
승환 김 댓글 2 좋아요 0 조회수 181

엑셀에 저장하기

미해결

[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)

# 엑셀 저장 df.to _excel( 'naver_finance_crawling.xlsx' ) 이렇게 했을 때 TypeError Traceback (most recent call last) Cell In[25], line 2 1 # 엑셀 저장 ----> 2 df .to_excel('naver_finance_crawling.xlsx', engine_kwargs=None) File ~/anaconda3/lib/python3.10/site-packages/pandas/util/_decorators.py:333 , in wrapper (*args, **kwargs) 324 return func(*args, **kwargs) 326 kind = inspect.Parameter.POSITIONAL_OR_KEYWORD 327 params = [ 328 inspect .Parameter("self", kind), 329 inspect .Parameter(name, kind, default=None ), 330 inspect .Parameter("index", kind, default=None ), 331 inspect .Parameter("columns", kind, default=None ), 332 inspect .Parameter("axis", kind, default=None ), --> 333 ] 335 for pname, default in extra_params: 336 params .append(inspect.Parameter(pname, kind, default=default)) File ~/anaconda3/lib/python3.10/site-packages/pandas/core/generic.py:2417 , in to_excel (self, excel_writer, sheet_name, na_rep, float_format, columns, header, index, index_label, startrow, startcol, engine, merge_cells, inf_rep, freeze_panes, storage_options, engine_kwargs) 2294 @final 2295 @doc(storage_options=_shared_docs["storage_options"]) 2296 def to_json( (...) 2309 storage_options: StorageOptions = None , ... 2547 """ 2548 from pandas.io import json 2550 if date_format is None and orient == "table": TypeError : ExcelFormatter.write() got an unexpected keyword argument 'engine_kwargs' Output is truncated. View as a scrollable element or open in a text editor . Adjust cell output settings ... 이런 에러가 발생합니다. 열심히 구글링을 해보았지만, 답을 찾을 수 없어서 질문 남깁니다 ㅠㅠ python은 3.10 사용중이고 pandas는 1.3.5 사용중입니다.

  • python
  • 웹-크롤링
신승민 댓글 2 좋아요 0 조회수 223

6. synchronized 문제 1 log출력

미해결

김영한의 실전 자바 - 고급 1편, 멀티스레드와 동시성

public static void main(String[] args) throws InterruptedException { Counter counter = new Counter(); Runnable task = new Runnable() { @Override public void run() { for (int i = 0; i < 10000; i++) { counter.increment(); log(counter.getCount()); // 로그 출력 추가!!!!!!!!!!!!!!! } } }; Thread thread1 = new Thread(task); Thread thread2 = new Thread(task); thread1.start(); thread2.start(); thread1.join(); thread2.join(); log(counter.getCount()); } static class Counter { private int count; public void increment() { count++; } public int getCount() { return count; } } 문제를 푸는 도중 count의 값을 확인해보고 싶어서 MyLogger.log(counter.getCount());를 호출했더니 문제 없이 20000이 계속 출력됩니다. synchronized를 사용하지 않아서 여전히 동시성 문제는 발생할텐데 어떻게 20000이라는 값이 나오게 되는지 궁금합니다!!

  • java
  • 객체지향
  • 동시성
  • multithread
  • thread
권정익 댓글 1 좋아요 1 조회수 207

강의 자료 부탁드립니다.

미해결

프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)

강의 자료 부탁드립니다! huo2100@naver.com

  • python
박건율 댓글 1 좋아요 0 조회수 157

pd.concat(df, ignore_index=True) InvalidIndexError 해결 방법 문의

미해결

내 업무를 대신 할 파이썬(Python) 웹크롤링 & 자동화 (feat. 주식, 부동산 데이터 / 인스타그램)

안녕하세요. 아래 코드에서 마지막 부분에서 에러가 발생하는데 찾아봐도 해결을 못하겠습니다. # 최종 데이터 합치기 df1 = pd.concat(df, ignore_index=True) --------------------------------------------------------------------------- InvalidIndexError Traceback (most recent call last) Cell In[89], line 2 1 # 최종 데이터 합치기 ----> 2 df1 = pd.concat(df, ignore_index=True) File ~\anaconda3\Lib\site-packages\pandas\core\reshape\concat.py:393, in concat(objs, axis, join, ignore_index, keys, levels, names, verify_integrity, sort, copy) 378 copy = False 380 op = _Concatenator( 381 objs, 382 axis=axis, (...) 390 sort=sort, 391 ) --> 393 return op.get_result() File ~\anaconda3\Lib\site-packages\pandas\core\reshape\concat.py:676, in _Concatenator.get_result(self) 674 obj_labels = obj.axes[1 - ax] 675 if not new_labels.equals(obj_labels): --> 676 indexers[ax] = obj_labels.get_indexer(new_labels) 678 mgrs_indexers.append((obj._mgr, indexers)) 680 new_data = concatenate_managers( 681 mgrs_indexers, self.new_axes, concat_axis=self.bm_axis, copy=self.copy 682 ) File ~\anaconda3\Lib\site-packages\pandas\core\indexes\base.py:3875, in Index.get_indexer(self, target, method, limit, tolerance) 3872 self._check_indexing_method(method, limit, tolerance) 3874 if not self._index_as_unique: -> 3875 raise InvalidIndexError(self._requires_unique_msg) 3877 if len(target) == 0: 3878 return np.array([], dtype=np.intp) InvalidIndexError: Reindexing only valid with uniquely valued Index objects ============================ df = [] articleNos = ['2433459189','2433504511'] for articleNo in articleNos: ind_url = f'https://new.land.naver.com/api/articles/{articleNo}?complexNo=' res = requests.get(ind_url, headers=headers) ind_dict = res.json() article_df = pd.Series(ind_dict['articleDetail']).to_frame().T # articleDetail_df = articleDetail_df[['articl/eNo','articleName','buildingTypeName','realestateTypeName', 'tradeTypeName', 'cityName','divisionName', 'sectionName', 'etcAddress', 'monthlyManagementCost', 'buildingName']] if 'articleFloor' in ind_dict.keys(): articleFloor_df = pd.Series(ind_dict['articleFloor']).to_frame().T article_df = pd.concat( [ article_df, articleFloor_df, ], axis=1 ) else: print(articleNo, '/', 'articleFloor') # articleFloor_df = articleFloor_df[['totalFloorCount','correspondingFloorCount']] if 'articlePrice' in ind_dict.keys(): articlePrice = pd.Series(ind_dict['articlePrice']).to_frame().T article_df = pd.concat( [ article_df, articlePrice, ], axis=1 ) else: print(articleNo, '/', 'articlePrice') # articlePrice_df = articlePrice_df[['dealPrice','allWarrantPrice','allRentPrice']] if 'articleRealtor' in ind_dict.keys(): articleRealtor = pd.Series(ind_dict['articleRealtor']).to_frame().T article_df = pd.concat( [ article_df, articleRealtor, ], axis=1 ) else: print(articleNo, '/', 'articleRealtor') # articleRealtor_df = articleRealtor_df[['realtorName','representativeName','cellPhoneNo','representativeTelNo']] if 'articleSpace' in ind_dict.keys(): articleSpace = pd.Series(ind_dict['articleSpace']).to_frame().T article_df = pd.concat( [ article_df, articleSpace, ], axis=1 ) else: print(articleNo, '/', 'articleSpace') # articleSpace_df = articleSpace_df[['supplySpace','exclusiveSpace']] # article_df = pd.concat( # [ # articleDetail_df, # articleFloor_df, # articlePrice_df, # articleRealtor_df, # articleSpace_df, # ], # axis=1 # ) df.append(article_df) # 최종 데이터 합치기 df1 = pd.concat(df, ignore_index=True)

  • python
  • 웹-크롤링
  • pandas
  • concat
초칼라 댓글 2 좋아요 0 조회수 510

인기 태그

인프런 TOP Writers

주간 인기글