묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
투포인터 boj3273문제 질문
안녕하세요! 투포인터 두 수의 합 문제에서 질문이 있습니다.a[l]+a[r] == x일 경우에는 l을 움직이면 다음 값이 x보다 더 커지니까 r을 움직여줘야한다고 강의에서 말씀하셨는데요, 주어진 수열이 1245 일 경우, l을 오른쪽으로 움직이면 a[l]+a[r]이 7이 돼서 x보다 더 커지긴 하지만, 다음번 반복에서 어차피 if(a[l]+a[r]>x) r--; 인 경우에 걸려서 r이 왼쪽으로 움직이고, 결국 그 다음번에 합이 6이 되는 것은 마찬가지 아닌가요?즉 r을 먼저 움직이고 값이 작아졌다가 다시 l을 움직여서 커지느냐 or l을 먼저 움직이고 값이 커졌다가 다시 r을 움직여서 작아지느냐의 차이라고 생각했는데 혹시 l이 아닌 r을 움직여주어야하는 이유가 무엇인지 궁금합니다! 아래 코드는 l을 움직여 주었을 때의 코드입니다 ㅎㅎhttp://boj.kr/92677f37be23452c8c4b9ca54f86dc58
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
캐글 개 나이 예측 문항
안녕하세요!작업형 2번 관련해서 질문 드려도 괜찮을까요…?혹시 get dummies 하기 전에 데이터 합치고 나눠야만 하나요..?수치형 데이터로 구성되어있고, 컬럼 같을 경우에는 합치고 나누는 작업 없이 get dummies 진행했는데 다른 풀이하고 결과값이 조금 차이 나는 것 같아서요! Get dummies 전후로 데이터 합치고 나누는 이유를 알고 싶습니다!제 코드# print(train.shape, test.shape)train = pd.get_dummies(train)test = pd.get_dummies(test)# print(train.shape, test.shape)다른 분들 모범 코드입니다¡data = pd.concat([train,test])data = pd.get_dummies(data)train = data.iloc[:len(train)]test = data.iloc[len(train):]
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
(체험 제2유형)
안녕하세요 선생님..이 문제에서 import pandas as pdpd.set_option('display.max_column',None)pd.set_option('display.float_format',"{:.10f}".format)train = pd.read_csv("data/customer_train.csv")test = pd.read_csv("data/customer_test.csv")# print(train.shape, test.shape) # 3500,11 / 2482 ,10개# print(train.isnull().sum()) # 환불금액 결측치 있음 2295 train = train.fillna(0)test = train.fillna(0)# print(train.isnull().sum()) 결측치 제거완료# print(train.head())# print(train.info()) # 주 구매상품, 주 구매지점# print(train.describe(include='object')) # 유니크가 42개, 24개라서 라벨인코더 가야할듯# cols = train.select_dtypes(inclued='object').coulmns !!!!# print(train.head())cols = ['주구매상품', '주구매지점']# print(train['주구매상품'].nunique())# print(test['주구매상품'].nunique())# print(train.describe(include='O'))# print(test.describe(include='O'))from sklearn.preprocessing import LabelEncoderfor col in cols : le = LabelEncoder() train[col] = le.fit_transform(train[col]) test[col] = le.transform(test[col])# print(train.shape, test.shape)# print(train.head())target = train.pop('성별')# print(target)from sklearn.model_selection import train_test_splitX_tr,X_val,y_tr,y_val = train_test_split(train,target,test_size=0.2)# print(X_tr.shape, X_val.shape, y_tr.shape, y_val.shape) # 2800from sklearn.metrics import roc_auc_scorefrom sklearn.ensemble import RandomForestClassifierrf = RandomForestClassifier()rf.fit(X_tr,y_tr)pred = rf.predict_proba(test) <---- 실행했는데 여기를 실행하면 ValueError: X has 11 features, but DecisionTreeClassifier is expecting 10 features as input.가 발생합니다.. 대체 왜 그럴까요 ㅠㅠ??
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
캐글 T1-34 문제 질문 (꼬리문제 1번)
제가 쓴 코드와 답안으로 작성되어 있는 코드 답 차이가 1씩 나는데, 왜 차이가 나는지 잘 모르겠네요 ㅜㅜ제가 쓴 코드에서 잘못된 부분이 있는지 말씀해주시면 감사하겠습니다.import pandas as pd import numpy as np df = pd.read_csv('/kaggle/input/bigdatacertificationkr/website.csv') # print(df.info()) # print(df.head()) df['StartTime'] = pd.to_datetime(df['StartTime']) df['EndTime'] = pd.to_datetime(df['EndTime']) # print(df.info()) # print(df.head()) df['total_seconds'] = (df['EndTime'] - df['StartTime']).dt.total_seconds() // 60 // 60 df = df.groupby(['UserID', 'Page']).mean() # print(df) df1 = df.groupby('Page')['total_seconds'].idxmax() # print(df1) print(int(df.loc[df1, 'total_seconds'].sum()))
-
미해결[코드팩토리] [입문] Dart 언어 4시간만에 완전정복
궁금한 점이 있습니다!
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.강사님 강의목록에 자바스크립트 강의도 있고 플러터 강의도 함께 있어서 단순 궁금증에 질문을 남겨봅니다.제가 앱 개발에 관심이 있어서 인프런을 뒤지던 중에 선생님 강의를 발견했습니다. 들어와보니 자바스크립트도 강의하시고 플러터도 강의하셔서 자바스크립트면 리액트네이티브로 앱개발을 할 수 있을텐데 플러터로 강의를 하신 것이 궁금했습니다. 플러터가 리액트네이티브보다 더 메리트가 있나요?
-
해결됨[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
버튼 setOnClickListener 작동하지 않습니다
섹션5, 네비게이션을 만들어보는 강의에서네비게이션 버튼을 만들고 프래그먼트로 연결시키는 작업까지 완료하고 실행시켜보았을 때 버튼을 눌렀지만, 2번째 프래그먼트로 넘어가지 않습니다.로그를 추가해서 살펴보았는데,버튼이 아예 클릭되지 않는 것 같습니다.코드는 드라이브 링크를 남기겠습니다. 감사합니다https://drive.google.com/drive/folders/1ri7_CYyzzRrhdMA7vII7TSMJsR9AIcJE?usp=drive_link
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
2유형에서 수치형 데이터를 스케일처리하는게 좋을지?
2유형 문제에서 수치형 데이터를 스케일 처리하는게 좋을지 그냥 놔두는게 좋을지 모르겠어요. 혹시 처리와 미처리의 기준이 있나요?
-
미해결[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)
이렇게 해도 될까요 ?
purchase = int(purchase.replace("만","000").replace(".","")) 이런식으로 작성해도 될까요 ?
-
미해결
JPA @Query 로는 동적쿼리 작성은 불가능한가요?
QueryDSL로는 구현이 어려워, 네이티브 쿼리를 작성하려고 합니다.그런데, where 조건을 동적으로 작성해야하는데... @Query의 경우 동적쿼리가 불가능한가요?
-
해결됨쿠버네티스 어나더 클래스-Sprint3 (#실무핵심 #Docker #Nginx #Minio #Longhorn)
안녕하세요, 로컬 환경 세팅 질문입니다.
현재 re-login으로 시도해 봤는데 계속 팅기는 것 같습니다.토큰으로 해봐도 안 되더라구요.위에 페이지도 봤는데위 빨간색 문구가 나오네요..어떻게 해결하면 좋을까요?
-
미해결설계독학맛비's 실전 FPGA를 이용한 HW 가속기 설계 (LED 제어부터 Fully Connected Layer 가속기 설계까지)
8강 AXI4-Lite 수강 중 입니다. Launch Hardware 진행시 작동이 안됩니다 ㅠ
안녕하세요 맛비님.FPGA 8장 실습을 진행하고 있습니다.환경은 아래와 같습니다.보드: ZYBO Z7-20VIVADO: 2024.01VITIS: Classic 2024.01 2022.01 이후 버젼 main.c 코드를 적용하여 사용했습니다.Makefile에 Code 붙여넣기도 해서 Build 진행시 이상없구요.Terminal 연결해서 UART 붙는 것 까지는 됐습니다만.. Launch Hardware 진행 후 UART창에서 아무 커맨드가 나오지 않는 현상이 지속됩니다..프로젝트, 파일 명도 맛비님 강의랑 동일하게 진행했는데 이유가 뭔지 모르겠네요..관련 증상에 대해 아시는 부분 있으면 답변 부탁드립니다.
-
미해결비전공자도 이해할 수 있는 AWS 입문/실전
영상이 보이지 않습니다.
안녕하세요 🙂 유튜브에서 도커 강의를 보다가 강의가 너무 좋아서 인프런으로 넘어온 학생입니다. 다름이 아니라 리전 선택하기 강의에서부터 몇개의 강의들이 영상이 보이지 않고 음성만 나와서 문의드립니다. 감사합니다 :)
-
미해결김영한의 실전 자바 - 기본편
상속시 메모리 구조와 @Overriding 어노테이션 관련 질문 드립니다.
안녕하세요.좋은 강의 정말 재미있게 잘 수강하고 있습니다. '상속과 메서드 오버라이딩' 강의 내용 관련하여 궁금한 점이 생겨 질문 드립니다. A와 B는 강의에서 설명해주신 내용입니다. [A.상속시 메모리 구조]상속한 클래스의 메서드를 호출하는 경우에1)본인 타입에서 해당 메서드를 먼저 찾고2-1) 없으면 부모 타입에서 찾는다2-2) 있으면 종료 [B. @Overriding]자식 클래스의 메서드에 @Overriding 애노테이션을 붙여 오버라이딩 수행 시, 부모 클래스에 해당 메서드가 존재하지 않으면 컴파일 오류가 발생 그런데 여기에서 B 처럼 동작하려면 A의 2-2 경우에 자식 타입만 조사하고 종료하는 것이 아니라, 컴파일 타임에 부모 클래스의 메서드도 조사해야하지 않나요?@Overriding 애노테이션을 사용했을 때 실제로 어떤식으로 동작하는지 궁금합니다. 감사합니다.
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
원핫인코딩
인코딩 에러가 나기전에 모든 test와 train에 대해서 전부 concat으로 합치고 원핫 인코딩 후다시 풀어도 아무문제없을까요?
-
미해결홍정모의 따라하며 배우는 C++
강의중 햇갈려서 질문올립니다
여기 강의에서 main 에 나오는 array 는 그냥 array 로 선언되서 array가 맞다는것은 이해가 됬는데 다만 doSomething 에서의 students_scores가 왜 array 가 아닌 pointer 인지 당쵀 이해가 안됩니다.... 혹시 자세히 설명 부탁드려도 되겠습니까?
-
미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
D-Day 앱 만들기에서 에러가 나옵니다ㅠㅠ
하나는 "NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null" 이런 에러인거 같은데....대체 어디서 잘못된걸까요. 에러가 여러개 인건가요?FAILURE: Build completed with 2 failures.1: Task failed with an exception.-----------* What went wrong:Execution failed for task ':app:checkDebugAarMetadata'.> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction > 5 issues were found when checking AAR metadata:* Try:> Run with --info or --debug option to get more log output.> Run with --scan to get full insights.* Exception is:org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:checkDebugAarMetadata'. Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction Caused by: java.lang.RuntimeException: 5 issues were found when checking AAR metadata: 1. Dependency 'androidx.appcompat:appcompat-resources:1.7.0' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 2. Dependency 'androidx.appcompat:appcompat:1.7.0' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 3. Dependency 'androidx.core:core-ktx:1.13.0' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 4. Dependency 'androidx.core:core:1.13.0' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 5. Dependency 'androidx.annotation:annotation-experimental:1.4.0' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). ==============================================================================2: Task failed with an exception.-----------* What went wrong:Execution failed for task ':app:mergeExtDexDebug'.> Could not resolve all files for configuration ':app:debugRuntimeClasspath'. > Failed to transform appcompat-resources-1.7.0.aar (androidx.appcompat:appcompat-resources:1.7.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=24, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}. > Execution failed for DexingNoClasspathTransform: C:\Users\abc14\.gradle\caches\transforms-3\c494794d48d9429ce3837ff3d9162578\transformed\appcompat-resources-1.7.0-runtime.jar. > Error while dexing. > Failed to transform appcompat-1.7.0.aar (androidx.appcompat:appcompat:1.7.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=24, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}. > Execution failed for DexingNoClasspathTransform: C:\Users\abc14\.gradle\caches\transforms-3\d251d80cfc588f74172158875c7b2196\transformed\appcompat-1.7.0-runtime.jar. > Error while dexing.* Try:> Run with --info or --debug option to get more log output.> Run with --scan to get full insights.* Exception is:org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeExtDexDebug'. Caused by: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null Caused by: java.util.concurrent.ExecutionException: com.android.tools.r8.utils.P0: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null Caused by: [CIRCULAR REFERENCE: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null]Cause 2: org.gradle.api.internal.artifacts.transform.TransformException: Failed to transform appcompat-1.7.0.aar (androidx.appcompat:appcompat:1.7.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=24, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}. Caused by: org.gradle.api.internal.artifacts.transform.TransformException: Execution failed for DexingNoClasspathTransform: C:\Users\abc14\.gradle\caches\transforms-3\d251d80cfc588f74172158875c7b2196\transformed\appcompat-1.7.0-runtime.jar. Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing. at com.android.builder.dexing.D8DexArchiveBuilder.getExceptionToRethrow(D8DexArchiveBuilder.java:189) Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\abc14\.gradle\caches\transforms-3\d251d80cfc588f74172158875c7b2196\transformed\appcompat-1.7.0-runtime.jar:androidx/appcompat/app/ActionBarDrawerToggle$1.class Caused by: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null Suppressed: java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.android.tools.r8.utils.P0: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null Caused by: java.util.concurrent.ExecutionException: com.android.tools.r8.utils.P0: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null Caused by: com.android.tools.r8.utils.P0: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null Caused by: [CIRCULAR REFERENCE: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null]
-
미해결선형대수학개론
linearly independent / dependent의 조건
안녕하세요. 어떤 벡터의 집합이 linearly independent인지 dependent한지 판별하는 부분의 해당 벡터의 linear system이 homogeneous linear system인 경우에만 해당되나요?
-
미해결
QueryDSL 에서 중복된 데이터를 제거하고, 집계함수(count, sum 등)을 적용하는 방법에 대해 조언 구합니다!
JOIN으로 인해서, 아래와 같이 중복되는 데이터가 발생했습니다.id | price1 50001 50002 60002 6000따라서, Distinct를 통해 아래와 같이 중복데이터를 제외하고, groupBy(id)를 통해 id별로 price의 sum을 구해야 합니다.id | price1 50002 6000이를 쿼리로 짜야한다면... JOIN 이후 Distinct를 적용한 서브쿼리를 From으로 조회해서 다시 groupBy(id) 를 통해 price의 sum을 구해야하는데요...위와 같이, subquery를 from 으로 조회해야 한다면... QueryDSL 을 통해 subquery를 from으로 조회하는 문법과 관련한 내내용을 아시는 분 계실까요 ㅠ(링크라도 부탁드립니다 ㅠ)아니면 혹시 다른 방법이 있을까요?- 본래 집계함(count, sum 등)수와 distinct 를 동시에 사용할 수 있는 것으로 압니다. 그런데 QueryDSL의 경우 countDistinct() 는 존재하는데... sumDisctinct()는 없는 것 같더라고요. 선배님들의 도움 절실히 부탁드립니다 ㅠ
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
개수가 불일치 합니다
안녕하세요. 작업형 2 한가지 방법으로 풀기의 내용으로예시문제 작업형 2를 푸는데 개수가 맞지 않아서 질문 드립니다..ValueError: X has 73 features, but DecisionTreeClassifier is expecting 74 features as input.import pandas as pd train = pd.read_csv("data/customer_train.csv") test = pd.read_csv("data/customer_test.csv") # 사용자 코딩 # print(train.shape, test.shape) # print(train.head(1), test.head(1)) # print(train['성별'].value_counts()) # print(train.isnull().sum(), test.isnull().sum()) train['환불금액'] = train['환불금액'].fillna(0) test['환불금액'] = test['환불금액'].fillna(0) target = train.pop('성별') print(train.shape, test.shape) train = pd.get_dummies(train) test = pd.get_dummies(test) print(train.shape, test.shape) from sklearn.model_selection import train_test_split X_tr, X_val, y_tr, y_val = train_test_split(train, target, test_size=0.2, random_state=0) print(X_tr.shape, X_val.shape, y_tr.shape, y_val.shape) from sklearn.ensemble import RandomForestClassifier rf = RandomForestClassifier(random_state=0) rf.fit(X_tr, y_tr) pred = rf.predict_proba(X_val) from sklearn.metrics import roc_auc_score roc_auc = roc_auc_score(y_val, pred[:,1]) print('\n roc_auc:', roc_auc) pred = rf.predict_proba(test) print(pred[:3]) submit = pd.DataFrame({'pred':pred[:,1]}) submit.to_csv("result.csv", index=False)
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
기출 4회
섹션 13 기출 4회 풀이때는 train ,test데이터의 id값을 drop 해주셨는데 한가지 방법으로 풀이 때는 원핫인코딩을 해주셔서 drop을 안해주신건가요?