Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val id
- Cat 1
- Tiger 2
- Ball 3
- Bat 1
- l = []
- a = 0
- while a < lendata:
- if df["id"][a] == 1:
- if a != 0:
- df["val"][tmp] = ' '.join(l)
- l = []
- tmp = a
- l.append(df["val"][a])
- else:
- l.append(df["val"][a])
- a += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement