Data science

Stage 1 · Lesson 3 of 7

Loading and inspecting a DataFrame

Python for data: NumPy and pandas

A is a table in memory: named columns, each one a single type, with rows that line up across them. Almost every analysis starts with pd.read_csv or a similar reader, then three checks: shape for the number of rows and columns, info() for types and non-missing counts, and head() for a first look at real values.

Tell the reader which columns are dates with parse_dates, and check that numbers really came in as numbers. Learn the difference between a DataFrame and a Series, which is a single column, and how the index labels rows.

Common trapskipping the type check: one stray "N/A" string in a price column makes pandas read the whole column as text, and every later calculation breaks or quietly gives the wrong answer.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

  • CoursePaid
    Grokking Python Fundamentals

    Design Gurus · Beginner · $50

    Solid Python basics first: data types, collections, functions and files, the ground pandas stands on

  • CourseFree
    Kaggle Learn

    Kaggle · Beginner

    Free: the Python and Pandas courses, short lessons with exercises that run in the browser

Practise

  • Pick one dataset on a topic you care about and repeat every operation in this stage on it

Keep handy

  • The indexing, merging and reshaping pages answer most "how do I" questions

  • The absolute beginners guide, then the reference when an array does something unexpected

Also worth your time

Mark this stage as not done?