OPTSTRUCT
분류 전체보기
(97)
홈
태그
미디어로그
위치로그
방명록
/
/
블로그 내 검색
학점 Grade 계산
오늘보다 나은 내일
2022. 5. 13. 10:00
2022. 5. 13. 10:00
import
pandas
as
pd
df
=
pd
.
DataFrame
([
80
,
90
,
70
,
50
,
40
],
columns
=[
'mathVal'
])
df
[
'Grade'
] =
list
(
map
(
lambda
x
:
"A"
if
(
x
>=
90
)
else
(
"B"
if
(
x
>=
80
)
else
(
"C"
if
(
x
>=
70
)
else
"D"
)),
df
.mathVal))
print
(
df
)
공유하기
게시글 관리
OPTSTRUCT
+ Recent posts
Powered by
Tistory
, Designed by
wallel
Rss Feed
and
Twitter
,
Facebook
,
Youtube
,
Google+
티스토리툴바