How to use Pandas DataFrame
Land Your First Data Science Job
A proven roadmap to prepare for $75K+ entry-level data roles. Perfect for Data Scientist ready to level up their career.
Pandas is today one of the leader in the Data Science industry due to its state of the art Python data manipulation toolkit.
DataFrames are at the core of the Pandas library.
A DataFrame can be understood exactly as an excel spreadsheet.
With column and rows.
Installation and Import
First of all, we need to install Pandas using the pip, the python package manager.
or
DataFrame core elements
Each column in a pandas.DataFrame is a pandas.Series.
And when you loop over the DataFrame each row can be understood as a Python dictionary.
How to create a DataFrame
At creation we can either pass a list as index and/or dictionary as data as argument.
The creation of a pandas.DataFrame is quite flexible.
At creation a DataFrame can be empty, with one index, without index but with data, with both an index and data.
The columns data are passed as lists within the data dictionary.
If you want to learn more about DataFrame and how to make the most out of them I wrote a lot of articles that you might find useful.
Land Your First Data Science Job
A proven roadmap to prepare for $75K+ entry-level data roles. Perfect for Data Scientist ready to level up their career.
Related Articles
Continue your learning journey with these related topics
Master Data Science in Days, Not Months 🚀
Skip the theoretical rabbit holes. Get practical data science skills delivered in bite-sized lessons – Approach used by real data scientist. Not bookworms. 📚