728x90
distance_from_sun = [149.6, 1433.5, 227.9, 108.2, 778.6]
planets = ['Earth','Saturn', 'Mars','Venus', 'Jupiter']
dist_planets=pd.Series(data=distance_from_sun,index=planets) # 변수지정, pandaseries 만들기
time_light=dist_planets/18 # 위 사진 요구사항 time_light 계산 후 저장
close_planets = time_light[time_light<40] # 위 사진 요구사항 close_planets 계산후 저장
실행 결과.
'Python' 카테고리의 다른 글
Python파이썬 pandas DataFrame 데이터 억세스(2) (0) | 2022.11.23 |
---|---|
Python파이썬 pandas DataFrame 데이터 억세스(1) (0) | 2022.11.23 |
Python파이썬 pandas 인덱스 (0) | 2022.11.23 |
Python파이썬 numpy의 boolean연산과 배열 연산 (0) | 2022.11.23 |
Python파이썬 numpy 중복 제거 값만 리스트로 가져오기 unipue() (0) | 2022.11.23 |