Convert DataFrame in Json , add column name as shown in desired output skill and suggestion after that saved as it is in MongoDB collection
Python Pandas DataFrame is as input
0 1 2 3 4 5 6 7
java hadoop java hdfs c c++ php python html
c c c++ hdfs python hadoop java php html
c++ c++ c python hdfs hadoop java php html
hadoop hadoop java hdfs c c++ php python html
hdfs hdfs hadoop java c c++ python php html
python python c++ html c php hdfs hadoop java
Desired Output saved into MongoDB collection as
{ "_id" : ObjectId("5922a781205a763b55e2e90e"), "skill" : "java", "suggestions" : [ "hadoop", "java", "hdfs", "c", "c++", "php", "python", "html" ] }
{ "_id" : ObjectId("5922a781205a763b55e2e91e"), "skill" : "c", "suggestions" : [ "c", "c++", "hdfs", "python", "hadoop", "java", "php", "html" ] }
{ "_id" : ObjectId("5922a781205a763b55e2e92e"), "skill" : "c++", "suggestions" : [ "c++", "c", "python", "hdfs", "hadoop", "java", "php", "html" ] }
{ "_id" : ObjectId("5922a781205a763b55e2e93e"), "skill" : "hadoop", "suggestions" : [ "hadoop", "java", "hdfs", "c", "c++", "php", "python", "html" ] }