Member-only story

Pandas Data Frame Concepts For Beginners

Exploring Data Frame Indexes, Axes, Data Selection, and Sorting

Jon McEwen
6 min readJul 4, 2022
Photo by Greg Rakozy on Unsplash

This article is a no-frills guide to getting up and running with Pandas data frames. If you are absolutely new to Python and Pandas, the easiest way to install both on your computer is through the Anaconda distribution.

With that out of the way, let’s get to the guide!

Data Frames

In Pandas, the primary data object you will interact with is a data frame. In a very basic way, you can think of a data frame as a spreadsheet of data.

You can create data frames from many different source inputs, but a CSV is one of the most common. Here’s how to set up your initial Jupyter notebook or python file with Pandas and then create a data frame from a CSV.

import pandas as pd
movies = pd.read_csv('sample_movie_data.csv')

Data Frame Anatomy

The easiest way to think of a data frame is as a python dictionary where each key maps to a different column. And each column is a series of indexed data.

Data Frame Axes

A data frame has two axes, 0 and 1. Axis 0 runs vertically over rows, and axis 1 runs horizontally over columns.

--

--

No responses yet