Pandas cheatsheet

1. Creating a Pandas Series

import pandas as pd

s = pd.Series([10, 20, 30, 40], index=['a', 'b', 'c', 'd'])
print(s)

2. Creating a Pandas DataFrame

data = {'Name': ['John', 'Anna', 'Peter', 'Linda', 'Tom'],
        'Age': [28, 24, 35, 32, 28],
        'City': ['New York', 'Paris', 'Berlin', 'London', 'New York']}

df = pd.DataFrame(data, index = ["a9", "b5", "d2", "r1", "x6"])
print(df)

3. Reading and Writing to CSV

4. Accessing Rows and Columns (Indexing and Slicing)

5. statistics

6. Filtering Data

7. Grouping and Looping Over Groups

8. Common Aggregation Functions

9. Column Operations: Adding, Multiplying, etc.

10. Sorting Data