I am using a api to get 3 json data and I would like to add those datas to 1 panda dataframes
This is my code I am passing in books which contains the book id as x and those 3 id returns me 3 different json objects with all the book information.
for x in books:
newDF = pd.DataFrame()
bookinfo = requests.get( http://books.com/?x})
books = bookinfo.json()
print(books)
This is the 3 arrays I get after printing books,
{
u'bookInfo':[
{
u'book_created':u'2017-05-31',
u'book_rating':3,
u'book_sold':0
},
{
u'book_created':u'2017-05-31',
u'book_rating':2,
u'book_sold':1
},
],
u'book_reading_speed':u'4.29',
u'book_sale_date':u'2017-05-31'
}
{
u'bookInfo':[
{
u'book_created':u'2017-05-31',
u'book_rating':3,
u'book_sold':0
},
{
u'book_created':u'2017-05-31',
u'book_rating':2,
u'book_sold':1
},
],
u'book_reading_speed':u'4.29',
u'book_sale_date':u'2017-05-31'
}
{
u'bookInfo':[
{
u'book_created':u'2017-05-31',
u'book_rating':3,
u'book_sold':0
},
{
u'book_created':u'2017-05-31',
u'book_rating':2,
u'book_sold':1
},
],
u'book_reading_speed':u'4.29',
u'book_sale_date':u'2017-05-31'
}
What I would like to do is only take u'bookInfo from the three arrays and make them into 1 dataframe