Study

2017년 3월 15일 수요일

[python] list slice index

data = [
    [1.0 , 1.0 , 4 , 10],
    [2.0 , 10.0, 4 , 10],
    [3.0 , 23.0, 4 , 10]
    ]

tempdata = [ item[2:] for item in data]

item[ 2 : ] mean from 2 to last

if want last - 1 element, just item [ 2 : -1 ]
작성자: jw 시간: 오후 7:47
이메일로 전송BlogThis!X에 공유Facebook에서 공유Pinterest에 공유

댓글 없음:

댓글 쓰기

최근 게시물 이전 게시물 홈
피드 구독하기: 댓글 (Atom)

프로필

jw
전체 프로필 보기

블로그 보관함

  • ►  2018 (26)
    • ►  6월 (1)
    • ►  5월 (8)
    • ►  4월 (8)
    • ►  2월 (6)
    • ►  1월 (3)
  • ▼  2017 (87)
    • ►  12월 (1)
    • ►  11월 (4)
    • ►  9월 (5)
    • ►  8월 (11)
    • ►  7월 (11)
    • ►  6월 (20)
    • ►  5월 (6)
    • ▼  3월 (13)
      • [python] pandas subplot
      • [python] List Combine
      • [python] flatten vs ravel
      • [algorithmn] 리스트의 순서를 바꾸지 않고, 각 값에 그 값의 크기에 할당된 크기...
      • [statistic] summery
      • [python] Decorator
      • [kivy] object connection
      • [python] list slice index
      • [python] class member add
      • [kivy] Naming Rule
      • [python] tkinter - openfile dialog start with init...
      • [statistic] Confusion matrix
      • [C#] Action and Func Chain
    • ►  2월 (13)
    • ►  1월 (3)
  • ►  2016 (78)
    • ►  12월 (6)
    • ►  11월 (13)
    • ►  10월 (4)
    • ►  9월 (9)
    • ►  8월 (15)
    • ►  7월 (7)
    • ►  6월 (4)
    • ►  5월 (2)
    • ►  4월 (5)
    • ►  3월 (13)
깔끔 테마. Powered by Blogger.