묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결재고시스템으로 알아보는 동시성이슈 해결방법
Redisson import
안녕하세요.Build.gradle에 Redisson을 import하는 과정에서 궁금증이 생겨서 질문합니다.처음에 Redisson을 검색해서 import를 했는데 Facade에서 생성자를 만들때 빨간줄이 뜨고, test를 돌려보니 에러가 나더라구요.importimplementation group: 'org.redisson', name: 'redisson', version: '3.2.0'import한 페이지https://mvnrepository.com/artifact/org.redisson/redisson/3.2.0생성자 경고 test errorjava.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@3f908a10 testClass = com.example.stock.facade.RedissonLockFacadeTest, locations = [], classes = [com.example.stock.StockApplication], contextInitializerClasses = [], activeProfiles = [], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.autoconfigure.actuate.observability.ObservabilityContextCustomizerFactory$DisableObservabilityContextCustomizer@9da1, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@16a0ee18, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@bd4dc25, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@71def8f8, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@1da2cb77, org.springframework.boot.test.context.SpringBootTestAnnotation@818c3651], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:142) at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:127) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:191) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:130) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:241) at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$10(ClassBasedTestDescriptor.java:377) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:382) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$11(ClassBasedTestDescriptor.java:377) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310) at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735) at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734) at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:376) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:289) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:288) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:278) at java.base/java.util.Optional.orElseGet(Optional.java:364) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:277) at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:105) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:104) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:68) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86) at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86) at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redissonLockFacade' defined in file [/Users/jialee/inflearn/stock/out/production/classes/com/example/stock/facade/RedissonLockFacade.class]: Unsatisfied dependency expressed through constructor parameter 0: No qualifying bean of type 'org.redisson.api.RedissonClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:798) 그래서 다시 검색해서 import 하니 생성자쪽에서 빨간줄은 뜨지 않지만, 테스트를 돌리면 동일한 에러가 나더라구요.importimplementation 'org.redisson:redisson-spring-boot-starter:3.17.4'혹시 두 inport의 차이점은 무엇이며, 왜 계속 테스트가 실패하는건지도 문의드립니다. + 추가로 git 주소도 남깁니다.https://github.com/uiop9900/stock.git
-
해결됨Jenkins를 이용한 CI/CD Pipeline 구축
AWS에서 Amazon Linux 2023 AMI를 사용 하면 안되나요?
안녕하세요. Amazon Linux 2 AMI를 사용해서 다시 인스턴스 만들기 직전입니다..Amazon Linux 2023이 최신이길래 이걸로 셋팅 했더니 amazon-linux-extras 사용이 안되고어떻게 tomcat 설치 까지는 실습 했는데 ansible 설치가 안되네요. 이건 인스턴스를 Amazon Linux 2 AMI로 새로 만들어야 할 수 밖에 없나요?
-
해결됨한 입 크기로 잘라먹는 타입스크립트(TypeScript)
함수 매개변수 타입의 호환성
함수의 매개변수 타입에서 업캐스팅은 에러가 발생하고, 다운캐스팅은 실행 되는 이유가 슈퍼타입에서 서브타입으로 상속 받았기 때문이라고 이해해도 될까요?
-
미해결유니티 Addressable 을 이용한 패치 시스템 구현
카탈로그 질문..
제가 잘못해서 previous build를 안하고 default build를 해서지금 이렇게 됐고, 앱의 버전은 1.0.7인데, 이 버전의 setting.json은이거인데요...제가 이걸 누르고 previous build를 하고..aws s3 서버에 덮어 씌우기 했는데도...업데이트가 되지 않아요...뭐가 문제인걸까요?...어떻게 해결하면 될까요?ㅠ... 그리고 1.0.1~1.0.6 버전에는 예전 카탈로그를 썼는데,default build 해서 최신 카탈로그로 하고, 1.0.7 버전으로 앱 빌드 하면.1.0.7 버전의 최신 카탈로그로 업데이트 되는거 맞나요?
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 영화 사이트 만들기
npm run dev 오류
npm run dev 명령어를 실행했을 때 다음과 같은 에러 로그가 생성됩니다.react-boiler-plate@1.0.0 dev> concurrently "npm run backend" "npm run start --prefix client"sh: concurrently: command not found
-
해결됨한 입 크기로 잘라 먹는 리액트(React.js) : 기초부터 실전까지
비동기를 동기로 처리하는 이유
비동기 함수를 왜 굳이 동기처럼 실행시키기 위해 await을 사용하는 건가요?처음부터 함수를 만들때 동기로 만들면 되는거 아닌가요?동기, 비동기가 잘이해가 안가네요..
-
미해결확률과 통계 기초
8.4 ex01 random sameple size질문입니다.
Normal distribution일려면 RV size가 30 이상이었던 것으로 기억하는데 ex1처럼 20인 경우에도 적용 가능한가요?제가 놓치는 부분이 있는거 같아서 질문드리게 되었습니다
-
미해결캐글 Advanced 머신러닝 실전 박치기
깃허브 주소 문의드립니다.
안녕하세요! 선생님 강의 열심히 듣고 있는 학생입니다 "Anaconda와 Jupyter notebook 셋업하기"를 보면 선생님 깃허브에 들어가서 DLCV 파일을 다운받으라고 하셨는데, 깃허브 주소가 어떻게 되시나요? 아무리 찾아도 나오지 않아 문의드립니다.
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
엔티티 클래스 개발2 h2 db 업데이트 오류 및 intellij 자동 종료
엔티티 클래스 개발2 강의 8분까지의 내용을 따라하는 중인데cmd로 db실행해도 db과 최신화 되어있지 않습니다.그리고 intellij에서 메인 클래스 실행하면 강의와 다르게 자동 종료됩니다.해결 방법 문의 드립니다. https://drive.google.com/drive/folders/1UcqCYHfwffTcVLU7QlbHylGEY2djBH9f?usp=sharing
-
미해결재고시스템으로 알아보는 동시성이슈 해결방법
섹션 3에서의 모든 테스트 케이스가 동작하지 않는데 문제점을 모르겠습니다.
안녕하세요.섹션 3의 세 가지 락들을 따라하면서 코드를 작성했습니다.그런데 세 가지 모두 테스트 케이스가 동작하지 않습니다.PessimisticLock과 NamedLock 경우 재고가 감소하지 않습니다.. OptimisticLock의 경우는에서 동작하지 않습니다.사용한 자바 버전은 17입니다.소스코드 주소는https://github.com/torissi/synchronism-issue입니다.
-
미해결따라하면서 배우는 3D Human Pose Estimation과 실전 프로젝트
prepare_data에서 질문있습니다.
3분 14초쯤에 load_data_hm36.py 파일에서prepare_data에 56줄에서 pos_3d[:, 1:] -= pos_3d[:, :1]을 빼주는데각 subject중에서, 어느 한 action에 해당하는 3차원 point배열에서 첫번째 값들만 빼오고 그 값들을 전체 pos_3d에 빼주는 과정을 해주는데, 이 과정을 해주는 이유가 normalization 때문에 해주는 것인가요? 맞다면, 보통 normalization을 하는 과정이 데이터들의 평균값으로 빼주는 것으로 알고 있는데, 첫번째 값을 빼주신이유가 궁금합니다!!
-
미해결15일간의 빅데이터 파일럿 프로젝트
고사양 VM3 수업자료는 어디까지 설치되어 있는 상태인가요?
저사양 자료를 받아서 Cluster 1 구성을 하다가 지우고 고사양 자료를 받아서 Cloudera의 클러스터를 구성하려고 보니 이미 Cluster 1이 존재한다고 해서 server01.hadoop.com/cmf 에 접속해 봤더니 컴포넌트들까지 Cluster 1이른 이름으로 모두 설치되어 있는 것처럼 보입니다.고사양 자료를 받은 경우 어디서부터 제가 직접 수업을 들으며 따라 해야 할 지 모르겠습니다.
-
미해결애플 웹사이트 인터랙션 클론!
scrollLoop 함수 질문
const scrollLoop = () => { prevScroll = 0; // 스크롤값이 다시 0으로 시작하게 for (let i = 0; i < current; i++) { prevScroll += sceneInfo[i].scrollHeight; } console.log('prev', prevScroll) if (currentScroll > prevScroll + sceneInfo[current].scrollHeight) { current++; alert() } console.log('next', prevScroll) if (currentScroll < prevScroll) { current--; } };선생님 여기서 prevScroll에 for문으로 돌때 sceneInfo[i].scrollHeight; 여기서 이미 값을 더해줄텐데 왜 if (currentScroll > prevScroll) { current++; alert() }조건문에 저렇게 하면 작동이 안돼나요 제가 이해를 잘못하고 있는지 ...
-
미해결자바스크립트 알고리즘 문제풀이 입문(코딩테스트 대비)
이렇게 풀어봤는데, 시간 복잡도가 많이 증가하는 코드 일까요?
(사진)
-
미해결입문자를 위한 코딩테스트 핵심(이론과 문제풀이) [Python]
이렇게 푸는건 효율적이지 못할까요?
def solution(nums): answer = -1 count = [0] * 1001 for x in nums: count[x] += 1 for y in range(len(count)): if count[y] == 1: if answer < y: answer = y return answer안녕하세요.선생님 코드와는 두번째 for문의 구현이 조금 다른데 이런 방식도 문제 없는지 궁금합니다.
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
6-D 시간복잡도 질문입니다.
안녕하세요 선생님.lower_bound나 upper_bound의 경우 vector의 크기가 n이면 시간복잡도가 n일 것 같은데이 문제의 경우에for(int i = 0; i < n; i++){ auto pos = lower_bound(v.begin()~~~)~~~`}이면 시간 복잡도가 n^2로 이분탐색하는 것보다 더 클 것 같은데 맞나요?
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
[시험환경에 적응하기:작업형2] 'DataConversionWarning'이유 알려주세요
작업형2를 아래와 같이 했는데 DataConversionWarning 나왔습니다검색해보니 y_train 변경때문이며 ravel()을 사용하라고하는데 이유 설명 부탁 드립니다[error명]DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples,), for example using ravel().[작성내용]import pandas as pdX_test = pd.read_csv("data/X_test.csv")X_train = pd.read_csv("data/X_train.csv")y_train = pd.read_csv("data/y_train.csv")pd.set_option('display.max_columns',None)# 사용자 코딩#print(X_train.shape,X_test.shape,y_train.shape)#print(y_train.isnull().sum())#print(X_train['환불금액'].describe())X_train['환불금액']=X_train['환불금액'].fillna(X_train['환불금액'].mean())X_test['환불금액']=X_test['환불금액'].fillna(X_train['환불금액'].mean())#print(X_train.isnull().sum())X_train=X_train.drop('cust_id',axis=1)X_test_id=X_test.pop('cust_id')y_train=y_train.drop('cust_id',axis=1)#print(X_test.head(2))#print(X_train.select_dtypes(exclude='object').columns)# '주구매상품', '주구매지점'# '총구매액', '최대구매액', '환불금액', '내점일수', '내점당구매건수', '주말방문비율', '구매주기'from sklearn.preprocessing import LabelEncodercols=['주구매상품', '주구매지점']for col in cols: le=LabelEncoder() X_train[col]=le.fit_transform(X_train[col]) X_test[col]=le.transform(X_test[col])#print(X_train.head()) from sklearn.preprocessing import MinMaxScalercols2=['총구매액', '최대구매액', '환불금액', '내점일수', '내점당구매건수', '주말방문비율', '구매주기']scaler=MinMaxScaler()X_train[cols2]=scaler.fit_transform(X_train[cols2])X_test[cols2]=scaler.transform(X_test[cols2])#print(X_train.head(2))from sklearn.model_selection import train_test_splitX_tr,X_val,y_tr,y_val=train_test_split(X_train,y_train, test_size=0.3, random_state=2023)#print(X_tr.shape,X_val.shape,y_tr.shape,y_val.shape)#(2450, 9) (1050, 9) (2450, 1) (1050, 1)from sklearn.metrics import roc_auc_scorefrom sklearn.ensemble import RandomForestClassifierrf=RandomForestClassifier(random_state=2023)rf.fit(X_tr,y_tr)pred=rf.predict_proba(X_val)print(roc_auc_score(y_val,pred[:,1]))#0.654227735236709
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
1-0 질문
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.http://boj.kr/07ed32a221874496820c25211823021a선생님 안녕하세요 강의 덕분에 많은 도움을 받고 있습니다.제가 쓴 코드에서 1번으로 하면 정답이 안나오는데 이유를 잘 모르겠어서 질문을 드립니다. 비록 부족한 지식에 정보 공유 부탁 드리겠습니다
-
미해결공공데이터로 파이썬 데이터 분석 시작하기
Swarmplot 에러
강의 회차 : [20/20] 지역별 분양가를 시각화하고 정리하기 질문 : 마지막 시각화 단계에서, boxplot, boxenplot, violinplot 다 잘 구현되는데 swarmplot만 계속 에러가 납니다. 구글에서 에러메시지 검색도 해 봤는데, 잘 해결이 안되네요.. 확인해 주실 수 있으신가요.* 에러메시지도 함께 첨부드립니다.--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[307], line 2 1 plt.figure(figsize=(24, 7)) ----> 2 sns.swarmplot(df, x='지역명', y='평당분양가격') File ~/anaconda3/lib/python3.10/site-packages/seaborn/categorical.py:2664, in swarmplot(data, x, y, hue, order, hue_order, dodge, orient, color, palette, size, edgecolor, linewidth, hue_norm, native_scale, formatter, legend, warn_thresh, ax, **kwargs) 2657 linewidth = size / 10 2659 kwargs.update(dict( 2660 s=size ** 2, 2661 linewidth=linewidth, 2662 )) -> 2664 p.plot_swarms( 2665 dodge=dodge, 2666 color=color, 2667 edgecolor=edgecolor, 2668 warn_thresh=warn_thresh, 2669 plot_kws=kwargs, 2670 ) 2672 p._add_axis_labels(ax) 2673 p._adjust_cat_axis(ax, axis=p.cat_axis) File ~/anaconda3/lib/python3.10/site-packages/seaborn/categorical.py:330, in _CategoricalPlotterNew.plot_swarms(self, dodge, color, edgecolor, warn_thresh, plot_kws) 321 def plot_swarms( 322 self, 323 dodge, (...) 327 plot_kws, 328 ): --> 330 width = .8 * self._native_width 331 offsets = self._nested_offsets(width, dodge) 333 iter_vars = [self.cat_axis] File ~/anaconda3/lib/python3.10/site-packages/seaborn/categorical.py:229, in _CategoricalPlotterNew._native_width(self) 226 @property 227 def _native_width(self): 228 """Return unit of width separating categories on native numeric scale.""" --> 229 unique_values = np.unique(self.comp_data[self.cat_axis]) 230 if len(unique_values) > 1: 231 native_width = np.nanmin(np.diff(unique_values)) File ~/anaconda3/lib/python3.10/site-packages/seaborn/_oldcore.py:1134, in VectorPlotter.comp_data(self) 1132 else: 1133 comp_col = pd.Series(dtype=float, name=var) -> 1134 comp_data.insert(0, var, comp_col) 1136 self._comp_data = comp_data 1138 return self._comp_data File ~/anaconda3/lib/python3.10/site-packages/pandas/core/frame.py:4786, in DataFrame.insert(self, loc, column, value, allow_duplicates) 4783 if not isinstance(loc, int): 4784 raise TypeError("loc must be int") -> 4786 value = self._sanitize_column(value) 4787 self._mgr.insert(loc, column, value) File ~/anaconda3/lib/python3.10/site-packages/pandas/core/frame.py:4877, in DataFrame._sanitize_column(self, value) 4875 return _reindex_for_setitem(value, self.index) 4876 elif is_dict_like(value): -> 4877 return _reindex_for_setitem(Series(value), self.index) 4879 if is_list_like(value): 4880 com.require_length_match(value, self.index) File ~/anaconda3/lib/python3.10/site-packages/pandas/core/frame.py:11620, in _reindex_for_setitem(value, index) 11616 except ValueError as err: 11617 # raised in MultiIndex.from_tuples, see test_insert_error_msmgs 11618 if not value.index.is_unique: 11619 # duplicate axis > 11620 raise err 11622 raise TypeError( 11623 "incompatible index of inserted column with frame index" 11624 ) from err 11625 return reindexed_value File ~/anaconda3/lib/python3.10/site-packages/pandas/core/frame.py:11615, in _reindex_for_setitem(value, index) 11613 # GH#4107 11614 try: > 11615 reindexed_value = value.reindex(index)._values 11616 except ValueError as err: 11617 # raised in MultiIndex.from_tuples, see test_insert_error_msmgs 11618 if not value.index.is_unique: 11619 # duplicate axis File ~/anaconda3/lib/python3.10/site-packages/pandas/core/series.py:4914, in Series.reindex(self, index, axis, method, copy, level, fill_value, limit, tolerance) 4897 @doc( 4898 NDFrame.reindex, # type: ignore[has-type] 4899 klass=_shared_doc_kwargs["klass"], (...) 4912 tolerance=None, 4913 ) -> Series: -> 4914 return super().reindex( 4915 index=index, 4916 method=method, 4917 copy=copy, 4918 level=level, 4919 fill_value=fill_value, 4920 limit=limit, 4921 tolerance=tolerance, 4922 ) File ~/anaconda3/lib/python3.10/site-packages/pandas/core/generic.py:5360, in NDFrame.reindex(self, labels, index, columns, axis, method, copy, level, fill_value, limit, tolerance) 5357 return self._reindex_multi(axes, copy, fill_value) 5359 # perform the reindex on the axes -> 5360 return self._reindex_axes( 5361 axes, level, limit, tolerance, method, fill_value, copy 5362 ).__finalize__(self, method="reindex") File ~/anaconda3/lib/python3.10/site-packages/pandas/core/generic.py:5375, in NDFrame._reindex_axes(self, axes, level, limit, tolerance, method, fill_value, copy) 5372 continue 5374 ax = self._get_axis(a) -> 5375 new_index, indexer = ax.reindex( 5376 labels, level=level, limit=limit, tolerance=tolerance, method=method 5377 ) 5379 axis = self._get_axis_number(a) 5380 obj = obj._reindex_with_indexers( 5381 {axis: [new_index, indexer]}, 5382 fill_value=fill_value, 5383 copy=copy, 5384 allow_dups=False, 5385 ) File ~/anaconda3/lib/python3.10/site-packages/pandas/core/indexes/base.py:4274, in Index.reindex(self, target, method, level, limit, tolerance) 4271 raise ValueError("cannot handle a non-unique multi-index!") 4272 elif not self.is_unique: 4273 # GH#42568 -> 4274 raise ValueError("cannot reindex on an axis with duplicate labels") 4275 else: 4276 indexer, _ = self.get_indexer_non_unique(target) ValueError: cannot reindex on an axis with duplicate labels
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
빅데이터 분석기사 (2회): 기출유형-작업형2 질문
안녕하세요 강사님 해당 강의를 듣던 도중 질문이 있어서 글 남깁니다. 라벨 인코딩 부분에서 cols = X_train.select_dtypes(include='object').columns으로 표현하였는데시험장에서는 그냥 info()를 통해 데이터타입 확인이후 object에 해당하는 컬럼들만 직접 수기로 입력해도 되나요?ex) cols = ['Warehouse_block', 'Mode_of_Shipment', 'Product_importance', 'Gender'] 라벨인코딩을 해야될때와 원핫인코딩을 해야될때 상황판단을 어떻게 하는지 궁금합니다. 그냥 매번 라벨인코딩만해도 무방할까요? 검증 데이터 분리시 test_size를 때에따라 0.1이나 0.2나 매번 바뀌는데 시험장에서는 성능이 더 좋은 test_size를 판단하기 위해 숫자를 바꿔가며 시도해봐야하나요? 그게 아니라면 그냥 test_size와 random_state는 0.1과 2023으로 해도 무방할지요 해당 강의와 마찬가지로 모델값들은 전부 같은 값이 나오는데 (0.7084055061812334, 0.6321275746145835, 0.7279225281811363, 0.7370938759652275)이를 이용해 예측 및 제출에서 pred를 형성하면 array안의 확률값이 다르게 나옵니다. 이유가 있을까요? 강의에서 score가 0.7정도면 괜찮은 성능이라고 하셨는데요. 시험장에서 채점기준에서 만점과 부분점수를 맞는 기준이 성능차이인가요? 만약 성능을 내지 못하고 전처리까지만 하고 csv파일을 만들지 않았다면 이는 부분점수도 못받는걸까요?? 한 질문에 여러가지 질문을 해서 죄송하게 생각합니다! 좋은 강의 감사드립니다