
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How to convert a spreadsheet to Python dictionary?
The easiest way to convert a spreadsheet to Python dictionary is to use an external library like pandas. This provides very helpful features like to_dict on excel objects. You can use these like −
Example
from pandas import * xls = ExcelFile('my_file.xls') data = xls.parse(xls.sheet_names[0]) print(data.to_dict())
Output
This will give the output −
{'id': 10, 'name': "John"}
- Related Articles
- How to convert Javascript dictionary to Python dictionary?
- How to convert Python Dictionary to a list?
- How to convert a string to dictionary in Python?
- How to convert a String representation of a Dictionary to a dictionary in Python?
- How to convert the string representation of a dictionary to a dictionary in python?
- Convert string dictionary to dictionary in Python
- How to convert list to dictionary in Python?
- How to convert Python dictionary keys/values to lowercase?
- How to convert a dictionary to a matrix or nArray in Python?
- How can I convert a Python Named tuple to a dictionary?
- How can I convert Python dictionary to JavaScript hash table?
- How to define a Python dictionary within dictionary?
- Python program to Convert Matrix to Dictionary Value List
- Python program to convert a list of tuples into Dictionary
- Python - Convert a set into dictionary

Advertisements