1.

Which of the following takes a dict of dicts or a dict of array-like sequences and returns a DataFrame?(a) DataFrame.from_items(b) DataFrame.from_records(c) DataFrame.from_dict(d) All of the mentionedI have been asked this question by my school principal while I was bunking the class.My doubt is from Pandas Data Structure in chapter Data Analysis with Python of Data Science

Answer»

Correct choice is (a) DataFrame.from_items

The explanation is: DataFrame.from_dict operates LIKE the DataFrame constructor except for the ORIENT parameter which is ‘COLUMNS’ by DEFAULT.



Discussion

No Comment Found

Related InterviewSolutions