TGViewer
Data Analytics Data Analytics @sqlspecialist · 111K subscribers
Post #565 42.3K
Python Learning Series Part-3

Complete Python Topics for Data Analysis: https://t.me/sqlspecialist/548

3. Pandas:

Pandas is a powerful library for data manipulation and analysis. It provides data structures like Series and DataFrame, making it easy to handle and analyze structured data.

1. Series and DataFrame Basics:
- Series: A one-dimensional array with labels, akin to a column in a spreadsheet.

     import pandas as pd

series_data = pd.Series([1, 3, 5, np.nan, 6, 8])

- DataFrame: A two-dimensional table, similar to a spreadsheet or SQL table.

     df = pd.DataFrame({
'Name': ['Alice', 'Bob', 'Charlie'],
'Age': [25, 30, 35],
'City': ['New York', 'San Francisco', 'Los Angeles']
})

2. Data Cleaning and Manipulation:
- Handling Missing Data: Pandas provides methods to handle missing values, like dropna() and fillna().

     df.dropna()  # Drop rows with missing values

- Filtering and Selection: Selecting specific rows or columns based on conditions.

     adults = df[df['Age'] > 25]

- Adding and Removing Columns:

     df['Salary'] = [50000, 60000, 75000]  # Adding a new column
df.drop('City', axis=1, inplace=True) # Removing a column

3. Grouping and Aggregation:
- GroupBy: Grouping data based on some criteria.

     grouped_data = df.groupby('City')

- Aggregation Functions: Computing summary statistics for each group.

     average_age = grouped_data['Age'].mean()

4. Pandas in Data Analysis:
- Pandas is extensively used for data preparation, cleaning, and exploratory data analysis (EDA).
- It seamlessly integrates with other libraries like NumPy and Matplotlib.

Here you can access Free Pandas Cheatsheet

Share with credits: https://t.me/sqlspecialist

Hope it helps :)
  • 👍 54
  • ❤ 14
  • 🥰 5
  • 👏 2
  • 🎉 1
More from @sqlspecialist
  1. Oct 8, 2026🎓 𝗠𝗶𝗰𝗿𝗼𝘀𝗼𝗳𝘁 𝗙𝗥𝗘𝗘 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝘄𝗶𝘁𝗵 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗲𝘀! 🚀🔥 Upgr…
  2. Oct 7, 2026📊 Kandinsky 6.0 Video: AI-Powered Content Creation for Analysts The new Kandinsky 6.0 Vid…
  3. Oct 7, 2026Alternatively, depending on the Excel version and requirement, I could use functions such…
  4. Oct 7, 2026📊 Data Analyst Interview Series — Part 5 Guys, let's continue our Data Analyst Interview…
  5. Oct 7, 2026🚀𝗣𝗮𝘆 𝗔𝗳𝘁𝗲𝗿 𝗣𝗹𝗮𝗰𝗲𝗺𝗲𝗻𝘁 𝗧𝗿𝗮𝗶𝗻𝗶𝗻𝗴 | 𝗕𝗲𝗰𝗼𝗺𝗲 𝗮 𝗙𝘂𝗹𝗹𝘀𝘁𝗮𝗰…
  6. Oct 7, 2026🔟 What is the difference between UNION and JOIN? Sample Answer: "JOIN combines columns fr…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →