Skip to content

DataFrame.from_records should be less strict about dict like types #3000

Closed
@tebeka

Description

@tebeka

Currently if you try DataFrame.from_records(emails, columns=['Subject', 'From', 'Date']) it'll fail. Emails are of type email.message.Message. However if you convert the email to dictionaries - the above code works.

The problem seems to stem from _to_arrays function in frame.py where the check is elif instance(data[0], dict). This fails even though email.message.Message has the full dictionary interface.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions