0

Hey guys i'm scraping an website which ultimately led me to an list consisting of First and last name of the users...I would like to separete every 2 items of this said list,group them and store them in another list that will contain all the first and last names grouped.

For example: ['Jhon', 'Doe', 'Joey', 'Santos']

Desired output : list1 = ['Jhon','Doe'] list2 = ['Joey','Santos']

Is there a way of automating this?

1 Answers1

0
>>> np.split(np.array(mylist), 2)
[array([1, 2, 3]), array([4, 5, 6])]

This will work.. so for your case get the len and divide it in the parts you need...

Yatish Kadam
  • 454
  • 2
  • 11