Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df:
- ID sem course
- 10 1 "math"
- 10 1 "phys"
- 10 1 "other"
- 10 2 "math"
- 10 2 "phys2"
- 10 2 "chem"
- 11 1 "other"
- 11 2 "math"
- mylist=list(NA)
- for in each ID {
- for j in each sem{
- check the element course=='math'{
- insert it into mylist (or do some other stuffs here)
- }}}
- mylist
- "math","math", "math"
Add Comment
Please, Sign In to add comment