Created
June 20, 2018 15:19
-
-
Save yang-zhang/633a4f8e20b2dd7dbe1ccffde7679a10 to your computer and use it in GitHub Desktop.
Convert a dictionary to pandas dataframe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dict_ = {'001.jpg': 'dog', '002.jpg': 'cat', } | |
df = pd.DataFrame.from_dict(dict_, orient='index').reset_index() | |
df.columns = ['image_name', 'tags'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment