Master Pandas Dataframe Operations with 120 free flashcards. Study using spaced repetition and focus mode for effective learning in Data Science.
A two-dimensional, size-mutable, tabular data structure with labeled axes (rows and columns), similar to a spreadsheet or SQL table.
Pandas (import pandas as pd).
pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
pd.DataFrame([{'a': 1}, {'a': 2, 'b': 3}]); missing keys become NaN.
pd.read_csv('file.csv').
pd.read_excel('file.xlsx', sheet_name='Sheet1').
pd.read_json('file.json') or pd.read_json('file.json', orient='records') for line-delimited JSON.
df.to_csv('file.csv', index=False); pass index=False to avoid writing the index.
Returns the first 5 rows by default; pass n to control the count.
Returns the last n rows (default 5).
df.shape returns a tuple (n_rows, n_cols).
df.columns returns an Index of column labels.
Flashcards
Flip to reveal
Focus Mode
Spaced repetition
Multiple Choice
Test your knowledge
Type Answer
Active recall
Learn Mode
Multi-round mastery
Match Game
Memory challenge