티스토리 뷰
# Counter collection
from collections import Counter
l = [1, 1, 1, 2, 3]
print(Counter(l))
s = "asadadasadadada"
print(Counter(s))
ss = "How many times does each word show up in this sentence word word"
words = ss.split()
print(Counter(words))
c = Counter(words)
print(c.most_common(4))
# 결과
Counter({1: 3, 2: 1, 3: 1})
Counter({'a': 8, 'd': 5, 's': 2})
Counter({'word': 3, 'show': 1, 'many': 1, 'in': 1, 'each': 1, 'sentence': 1, 'up': 1, 'times': 1, 'How': 1, 'does': 1, 'this': 1})
[('word', 3), ('show', 1), ('many', 1), ('in', 1)]
# defaultdict
from collections import defaultdict
d = defaultdict(object)
d['one']
for item in d:
print(item)
d = defaultdict(lambda : 0)
print(d['one'])
d['two'] = 2
for k, v in d.items():
print("Key: {}, Value: {}".format(k, v))
# 결과
one
0
Key: one, Value: 0
Key: two, Value: 2
# OrderedDict
from collections import OrderedDict
d = OrderedDict()
d['a'] = 1
d['b'] = 2
d['c'] = 3
d['d'] = 4
for k, v in d.items():
print(k, v)
# 결과
a 1
b 2
c 3
d 4
# namedtuple
from collections import namedtuple
Dog = namedtuple('Dog', 'age breed name')
sam = Dog(age = 2, breed = 'Lab', name = 'sammy')
print(sam.age)
print(sam[0])
# 결과
2
2
# deque
from collections import deque
q = deque([1, 2, 3])
q.append(4)
q.append(5)
print(q)
q.popleft()
print(q)
q.pop()
print(q)
# 결과
deque([1, 2, 3, 4, 5])
deque([2, 3, 4, 5])
deque([2, 3, 4])
# list enumerate
ls = [1, 2, 3]
for index, value in enumerate(ls):
print("value: {}, index: {}".format(value, index))
# 결과
value: 1, index: 0
value: 2, index: 1
value: 3, index: 2
- Total
- 410,766
- Today
- 35
- Yesterday
- 44
- 검은왕자
- www.skilledtesting.com Erkan..
- The Braidy Tester
- Hans Schaefer's home page
- systematic-testing.com
- Software Test & Performance..
- Professional Tester Magazine
- Pairwise Testing
- Methods & Tools - Providing..
- Model-Based Testing Home Page
- Dr. Dobb's Portal
- Jeff Offutt (Professor of So..
- Jeff Tian, Ph.D., P.E., Asso..
- Specialist Group in Software..
- StickyMinds.com
- Software QA/Test Resource Ce..
- AMERICAN SOCIETY FOR QUALITY
- Software Testing and Quality..
- Association for Software Tes..
- 다음 일본어 번역
- 네이버 일본어 번역
- 고재팬 일본어 번역
- The Software Engineering Res..
- QA Testing and Test Tools co..
- Information for people with..
- Testing Blog
- QASTREET.COM
- Bret Pettichord
- Tester Center
- I. M. Testy
- Glossary and Technical FAQs
- 위키독스
- Software Testing Mentor
- Martin Fowler's Bliki
- TestFocus
- Game Developers Blog
- smileson
- nihitk's blog
- The Test Management Guide
- Testing Foundations
- Grove Consultants
- 홍환민 페이지
- Free Video Tutorials about S..
- Sustainable Development
- 해리 로빈슨의 모델 기반 테스..
- 테스팅 써커스
- Home - Erik van Veenendaal
- URL metrics
- 소프트웨어 관리
- 경영학
- 자격증
- 소프트웨어 엔지니어링
- 소프트웨어 개발
- 추정
- 협업
- 경제
- 일정
- 평가모델
- Software Engineering
- 독서법
- 경영
- 책읽기
- 소프트웨어 테스트
- software testing
- 애자일