Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- dockerfile
- AWS
- docker-compose
- ubuntu
- staging area
- MySQL
- Ruby On Rails
- cron
- pagination
- working directory
- ruby
- php
- react
- laravel
- linux
- docker
- Git
- centOS7
- vue
- codeigniter4
- SQL
- props
- controller
- Python
- Selenium
- imagemagick
- NGINX
- ec2
- Wordpress
- javascript
Archives
- Today
- Total
목록Filter (1)
내가 한 노력들
[ python ] list 에서 value 값으로 다중 index 찾기
result = [1,2,3,4,5,3] result 라는 list 에서 원소값이 3인 index번호를 알고 싶을 때는??! print(test_list.index(3)) index() 를 사용하게되면 list안에 중복된 value가 있을 때에는 index 번호가 빠른 것만 결가값이 나오게 된다. 결과값 2 rest_list = list(filter(lambda x: test_list[x] == 3, range(len(test_list)))) print(rest_list) list(filter()) 를 이용해서 list안에 중복되는 value값이 있어도 다중의 index 번호를 list의 값을 준다. 결과값 [2, 5] 여기서 fillter()는 filter 함수는 built-in 함수로 list 나 d..
IT 공부/python
2020. 11. 18. 11:44