I have taken a json dataset. Dataset name is v2_OpenEnded_mscoco_train2014_questions.json How can I split some of the data from the dataset and save the split data into another json file?
This is the example of my dataset:
{"image_id": 426004, "question": "How many buns are on the plate?", "question_id": 426004002}, {"image_id": 92846, "question": "What is the color of the vase without flowers?", "question_id": 92846000}, {"image_id": 92846, "question": "Is there anything red in this photo?", "question_id": 92846002}, {"image_id": 92846, "question": "What does that vase represent?", "question_id": 92846003}, {"image_id": 262166, "question": "What color is the couch?", "question_id": 262166002}, {"image_id": 262166, "question": "How many seats are available?", "question_id": 262166003}
I have about 443,757 data in my dataset. I want to split the dataset into 400 different dataset each having 100 data. How can I automate this using python? It will be a great help if this can be done with pytorch.