df.sum() 과 sum(df) 차이가 뭔가요?
df.sum() 과 sum(df) 차이가 무엇인지 질문드립니다.
답변 2
1
Hello this is Gulshan Negi
Well, I search about it on internet and in short I can say.
The main difference between df.sum() and sum(df) is their usage and the objects they operate on.
df.sum() is a pandas DataFrame method that calculates the sum of each column by default. It returns a new pandas Series object containing the column-wise sums. It provides flexibility in specifying the axis of summation and handling missing or non-numeric values appropriately.
On the other hand, sum(df) is a built-in Python function that attempts to iterate over the columns of a data frame and calculate their sum. However, this usage might not work as intended because DataFrames are not inherently iterable in the same way as Python lists or tuples.
Thanks
0
sum(df) 파이썬 기본 함수
df.sum() 판다스 함수(정확히는 메소드)
입니다 💪
숫자외에 문자 컬럼이 있을 경우 판다스 버전이 업데이트되면서 워닝이 발생해요
df.sum(numeric_only=True)로 설정해주세요
작업형2모의문제3_updated2026.10
0
16
1
작업형2 모의문제3_updated2026.10
0
18
2
38강에서 불균형 데이터 처리하는 stratify를 꼭 해줘야하는건지 질문합니다.
0
20
2
수강강의 연장 관련 문의
0
23
1
작업형1_연습문제1 section2
0
26
2
수강기간 연장 문의드립니다
0
27
1
작업형2 모의문제2_updated2026.10
0
34
2
수강기간 연장문의
0
29
1
작업형 2 질문
0
35
2
강의 연장 관련하여 문의드립니다.
0
39
1
섹션7 자료 다운로드
0
44
2
작업형 1 연습문제 Section12
0
43
2
수강기간 연장 문의
0
54
1
안녕하세요, 혹시 수강기간 연장이 가능할까요?
0
46
2
판다스 강의자료는 어디서 받을 수 있나요?
0
55
2
작업형2 모의고사3 자료 업데이트 요청
0
61
4
수강 연장가능여부 문의드립니다!
0
50
2
수강기간 연장 문의드립니다!
0
44
2
최빈값
0
48
2
수강 가이드라인
0
41
2
수강 연장 가능 여부 문의
0
65
2
강의 구매했는데 교재 필수일까요
0
50
2
수강기간 연장 가부 문의드립니다.
0
47
2
수강기간 연장이 가능한지 양해를 구하며 문의를 드립니다.
0
47
2





