일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- TORCH
- Converting
- docker
- numpy
- GitLab
- CUDA
- DB
- Laravel
- Container
- enV
- Paper
- KAKAO
- PostgreSQL
- LLM
- Windows
- judge
- Python
- pandas
- Database
- Linux
- format
- Package
- Mac
- evaluation
- pytorch
- list
- Flask
- file
- git
- AI
- Today
- Total
목록list (3)
Daily Develope
리스트 (List) List의 Item 한 줄씩 출력 my_list = ["line1", "line2", "line3"] print(f"{my_list}", sep="\n")List 간단한 명령 한 줄로 처리 ### 예) a 값이 None 인 경우를 제외하고 덧셈 값 반환 sample = [[1, 2], [3, 4], [None, 6]] sample = [a+b for a, b in sample if a != None] >> print(sample) [3, 7]List 의 index 및 값 순차출력 t_list = [1, 5, 7, 33, 39, 52] for tup in enumerate(t): print(tup) ### output (0, 1) (1, 5) (2, 7) (3, 33) (4, 39) (..
Dict. 내부 정렬 ㅇ 샘플 samples = {'c':2, 'a':4, 'b':3, 'd':1, 'e':0} ㅇ 정렬 (숫자/value 기준 오름차순 정렬) sortedList = dict(sorted(samples.items(), key=lambda s: s[1])) print(sortedList) ----- {'e': 0, 'd': 1, 'c': 2, 'b': 3, 'a': 4} Dict. List 정렬 ㅇ 샘플 samples = [ {"name":"a", "score":50}, {"name":"b", "score":60}, {"name":"c", "score":20}, {"name":"d", "score":70}, {"name":"e", "score":20}, {"name":"e", "score..
문자열 매칭 s = "오늘은 기분이 '매우' 좋습니다." # 단순 문자열 확인 print("기분이" in s)# True print("나쁩니다" in s)# False # 정의된 문자열 리스트 중 일치하는 단어가 있는지 확인 print(any(x in s for x in ["좋습니다", "나쁩니다"])) # True print(any(x in s for x in ["그저그래요", "나쁩니다"])) # False # 정의된 문자열 리스트 모두가 일치하는지 확인 print(all(x in s for x in ["오늘은", "좋습니다"]))# True print(all(x in s for x in ["오늘은", "나쁩니다"]))# False 리스트 매칭 a=["hello", "world", "python"] ..