다음과 같이 코드를 작성했는데, 결과값에 .0 이 붙어서 출력됩니다. 왜 그런 걸까요? df['출동시간'] = pd.to _datetime(df['출동시간']) df['도착시간'] = pd.to _datetime(df['도착시간']) df['time'] = df['도착시간'] - df['출동시간'] result = df.groupby('소방서')['time'].mean() result = result.sort_values(ascending=False) result = round( result.dt.total _seconds() / 60) # round 함수에 반올림 위치를 명시하지 않으면 정수를 반환해야 하지 않나요?) print(result[0])
1. 현재 학습 진도 몇 챕터/몇 강을 수강 중이신가요? 2-10 챕터 어떤 알고리즘을 학습하고 계신가요? 더하거나 빼거나 문제 여기까지 이해하신 내용은 무엇인가요? 2. 어려움을 겪는 부분 어느 부분에서 막히셨나요? 재귀함수 코드의 어떤 로직이 이해가 안 되시나요? get_all_ways_by_doing_plus_or_minus(array, current_index + 1, current_sum + array[current_index]) get_all_ways_by_doing_plus_or_minus(array, current_index + 1, current_sum - array[current_index] 제가 이해 안가는것은 처음에 cur_index = 0 , cur_sum = 0 부터 시작하잖아요 get_all_ways_by_doing_plus_or_minus(array,1,2) get_all_ways_by_doing_plus_or_minus(array,1,-2) 그러고 다음 cur_index = 1 , cur_sum = 2 이렇게 흘러가는데, 왜 get_all_ways_by_doing_plus_or_minus(array,1,-2) -2 가 안가고 +2 가 가는지 궁금합니다. get_all_ways_by_doing_plus_or_minus(array, current_index + 1, current_sum + array[current_index]) 계산이 전부 끝난 뒤에 get_all_ways_by_doing_plus_or_minus(array, current_index + 1, current_sum - array[current_index] 가 이어서 오는건가요 ? 어떤 개념이 헷갈리시나요? 3. 시도해보신 내용 문제 해결을 위해 어떤 시도를 해보셨나요? 에러가 발생했다면 어떤 에러인가요? 현재 작성하신 코드를 공유해주세요 이렇게 구체적으로 알려주시면, 더 정확하고 도움이 되는 답변을 드릴 수 있습니다! 😊
63강 c언어 기출문제 변형해서 배열과 포인트 증가 문제에서 ++* ptr은 arr 인덱스 0 위치에 있는 숫자를 증가시키고 위치는 변하지 않는다 * ptr ++는 포인트 변수 ptr이 가지고 있는 값을 증가시키지 않고 arr 인덱스 1 위치로 이동한다 이렇게 이해하는게 맞나요?
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 2회 기출문제 작업형2에서 왜 쌤이 한거랑 다르게 결과가 나올까요,,,,,,,, # 검증 데이터 분리 아래는 쌤 풀이 입니다 ((7039, 11), (1760, 11), (7039,), (1760,)) 이건 제가 작성한 코드입니다 from sklearn.model_selection import train_test_split X_tr,X_val,y_tr,y_val = train_test_split ( X_train, y_train [ 'Reached.on.Time_Y.N' ] , test_size= 0.2 , random_state= 2022 ) X_tr.shape, X_val.shape, y_tr.shape, y_val.shape ((7039, 10), (1760, 10), (7039,), (1760,))
도서의 데이터를 불러오는 과정에서 Promise 객체에 id를 이미 사용해 book에 저장한 데이터들을 구조분해할당할 때 id가 이미 선언되었다고 오류가 발생합니다 ㅠㅠ 강의에서는 Promise 객체로 URL 파라미터를 받아오는 게 아니어서 어떻게 해결할 수 있는지 모르겠습니다... 아래는 코드랑 오류 메시지입니다! 코드의 붉은 줄에 커서를 올리면 블록 범위 변수 'id'를 다시 선언할 수 없다고 나옵니다
제가 실수로 robots.txt를 robot.txt로 잘못 올렸고 User-agent: * Disallow:: 내부 파일도 이렇게 잘못 작성했더니 lighthouse에서 잘못되었다고 지적하더라고요. 근데 새로 수정하고 빌드해서 올렸고 AWS s3내부에선 정상적인 파일이 올라간 것으로 확인되는데 아직도 그대로더라고요. 어떻게 최신화가 가능할까요?
안녕하세요. 오징어게임 관련해서 문의사항이 있어 남깁니다. 5/12 미션 [2-a 도서] 작업형1 연습문제 - 섹션1, 섹션2 (p.164~165)의 경우 시나공 2026 버전으로 작성해주신 것 같은데 제가 갖고 있는 2025 버전의 경우는, 섹션을 기준으로 풀면 되는지 문의드립니다! 답변해주시면 감사하겠습니다^^
(node:49559) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created) 설치할 때 터미널에 이러한 오류가 발생해서 시키는대로 node --trace-deprecation 를 입력했더니 아래 처럼 뜹니다. 그냥 무시해도 되겠죠? ➜ threads git:(master) ✗ node --trace-deprecation Welcome to Node.js v22.9.0. Type ".help" for more information. > punycode { version: '2.1.0', ucs2: { decode: [Function: ucs2decode], encode: [Function: ucs2encode] }, decode: [Function: decode], encode: [Function: encode], toASCII: [Function: toASCII], toUnicode: [Function: toUnicode] } > (node:51239) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. at node:punycode:3:9 at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:399:7) at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:338:10) at loadBuiltinModule (node:internal/modules/helpers:108:7) at Module._load (node:internal/modules/cjs/loader:1099:17) at TracingChannel.traceSync (node:diagnostics_channel:315:14) at wrapModuleLoad (node:internal/modules/cjs/loader:217:24) at Module.require (node:internal/modules/cjs/loader:1339:12) at get (node:internal/modules/helpers:223:33) at REPL1:1:1
# test 예측 pred = rf.predict_proba(test) ValueError Traceback (most recent call last) <ipython-input-221-192ffa211ac4> in <cell line: 0>() 1 # test 예측 ----> 2 pred = rf.predict_proba(test) 3 3 frames /usr/local/lib/python3.11/dist-packages/sklearn/utils/validation.py in _check_feature_names(estimator, X, reset) 2775 message += "Feature names must be in the same order as they were in fit.\n" 2776 -> 2777 raise ValueError(message) 2778 2779 ValueError: The feature names should match those that were passed during fit. Feature names unseen at fit time: - TravelInsurance 이런 오류가 뜹니다 test가 예측값이니까 TravelInsurance 컬럼이 없어야 하는게 맞는건가요? 샘플 찍어봤을 때 train,test 둘 다 TravelInsurance 이 컬럼이 있었습니다. 코드 작성은 선생님과 동일하게 했는데 자꾸 저런 오류가 뜨네요 ㅠㅠ 검증 데이터 분리할 때 train.drop만 해줘서 그런건가요..?