🐼

Pandas Essentials

93 cards · 🇺🇸 English

DataFrames, Series, and core Pandas data manipulation operations.

Study all 93 cards for free

Flashcards, quizzes, pixel-art games and a daily review that remembers for you.

Study this deck free

Try the first 10 cards

1 / 10
Question

Pandas

Knew itLearning

Tap the card for the answer · swipe right if you knew it, left if not

Already have an account? Sign in

Cards

  1. 1Pandas
    A Python library for data manipulation and analysis, offering data structures like Series and DataFrames
  2. 2Name 'Pandas'
    Panel data (econometrics term) and "Python data analysis"
  3. 3Pandas built upon
    NumPy
  4. 4Two main data structures in Pandas
    Series (1D) and DataFrame (2D)
  5. 5Pandas Series
    A one-dimensional array-like object with labeled indices
  6. 6Pandas DataFrame
    A two-dimensional tabular structure with labeled rows and columns
  7. 7Import Pandas conventionally
    import pandas as pd
  8. 8Create a Series from a list
    pd.Series(['a', 'b', 'c'])
  9. 9Access a value in a Series by label
    ser['label_name']
  10. 10What happens when you add two Series together?
    Values are aligned by matching index labels (similar to a join), then added
  11. 11Default index for a Series if none is provided
    Integer index ranging from 0 to n-1
  12. 12Create a DataFrame from a dictionary
    pd.DataFrame({"col1": [1, 2], "col2": [3, 4]})
  13. 13Read a CSV file into a DataFrame
    pd.read_csv('filename.csv')
  14. 14Access a DataFrame column as a Series
    df['column_name'] or df.column_name (if valid Python identifier)
  15. 15Df.loc[]
    Label-based indexing (access rows/columns by label)
  16. 16Df.iloc[]
    Position-based indexing (access rows/columns by integer position)
  17. 17Df.head()
    The first 5 rows of the DataFrame (or n rows if specified)
  18. 18Df.describe()
    Descriptive statistics (count, mean, std, min, max, quartiles) for numeric columns
  19. 19Df.shape
    A tuple (number of rows, number of columns)
  20. 20Df.dtypes
    The data type of each column
  21. 21Df.columns
    The labels of the DataFrame's columns as an Index object
  22. 22Df.index
    The labels of the DataFrame's rows as an Index object
  23. 23Df.values
    The data as a 2D NumPy array
  24. 24Filter rows based on a condition
    df[df['col'] > 5]
  25. 25Select multiple columns
    df[['col1', 'col2']]
  26. 26Sort a DataFrame by a column
    df.sort_values('column_name', ascending=True/False)
  27. 27Where are missing values sorted in a Series?
    Automatically to the end
  28. 28Df.groupby('col')
    Groups data by unique values in 'col', enabling aggregate operations
  29. 29.mean()
    Calculates the mean for each group
  30. 30.sum()
    Calculates the sum for each group

And 63 more cards. Study the whole deck free

Articles about this deck

More Programming decks

See all
Study all 93 cards free