본문 바로가기

데이터 꿈나무

검색하기
데이터 꿈나무
프로필사진 ye_ju

  • 분류 전체보기 (82)
    • AI (14)
      • Machine Learning (3)
      • Deep Learning (10)
      • LLM (0)
    • Language (31)
      • Python (25)
      • SQL (5)
      • R (1)
    • Activity (37)
      • KT AIVLE (3)
      • Intern (11)
      • 데이터 청년 캠퍼스 (6)
      • 학술 동아리 DAL (4)
      • Algorithm (13)
    • etc (0)
Guestbook
Notice
  • 깃허브 주소 yejuda
Recent Posts
Recent Comments
Link
«   2026/04   »
일 월 화 수 목 금 토
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Set (1)

데이터 꿈나무

[Python] set 자료형 - 교집합, 합집합, 차집합

※ 유의해야 할 점 리스트 형태로 되어있는 값을 set으로 묶어준 뒤 적용시켜야 한다. 📌 교집합 set1 = set([1,2,3,4,5,6]) set2 = set([3,4,5,6,8,9]) print(set1 & set2) # {3, 4, 5, 6} print(set1.intersection(set2)) # {3, 4, 5, 6} 📌 합집합 set1 = set([1,2,3,4,5,6]) set2 = set([3,4,5,6,8,9]) print(set1 | set2) # {1, 2, 3, 4, 5, 6, 8, 9} print(set1.union(set2)) # {1, 2, 3, 4, 5, 6, 8, 9} 📌 차집합 set1 = set([1,2,3,4,5,6]) set2 = set([3,4,5,6,8,9]..

Language/Python 2023. 2. 18. 21:41
이전 Prev 1 Next 다음

Blog is powered by AXZ / Designed by Tistory

티스토리툴바