Python for Data Analysts
51.7K subscribers
534 photos
1 video
71 files
328 links
Find top Python resources from global universities, cool projects, and learning materials for data analytics.

For promotions: @coderfun

Useful links: heylink.me/DataAnalytics
Download Telegram
๐Ÿ”ฐ Loops in Python
โค15
Dreaming of a perfect day as a data analyst?

Here is the reality check:

โ€ข You arrive at the office, grab a coffee, and dive deep into solving complex problems.
๐—•๐˜‚๐˜, you spend the first hour trying to figure out why one of your dashboards shows outdated data.


โ€ข You present impactful insights to a room full of executives, who trust your recommendations and are eager to execute your ideas.
๐—•๐˜‚๐˜, you will explain for the 10th time why Excel isnโ€™t the best tool for running the complex analysis they are requesting.


โ€ข You use the latest machine learning models to accurately predict future trends.
๐—•๐˜‚๐˜, you will spend whole days wrangling messy, incomplete datasets.


โ€ข You collaborate with a team of data scientists to create innovative solutions.
๐—•๐˜‚๐˜, you will have to send a dozen Slack messages to IT just to get access to the data you need.


โ€ข You spend the afternoon writing elegant, and efficient Python code.
๐—•๐˜‚๐˜, you will google basic pandas function more times than youโ€™d like to admit.


Manage your expectations and find humor in your daily work. Itโ€™s all part of the journey to those moments where you will drive real business impact as a data analyst!
โค14
Complete roadmap to learn Python and Data Structures & Algorithms (DSA) in 2 months

### Week 1: Introduction to Python

Day 1-2: Basics of Python
- Python setup (installation and IDE setup)
- Basic syntax, variables, and data types
- Operators and expressions

Day 3-4: Control Structures
- Conditional statements (if, elif, else)
- Loops (for, while)

Day 5-6: Functions and Modules
- Function definitions, parameters, and return values
- Built-in functions and importing modules

Day 7: Practice Day
- Solve basic problems on platforms like HackerRank or LeetCode

### Week 2: Advanced Python Concepts

Day 8-9: Data Structures in Python
- Lists, tuples, sets, and dictionaries
- List comprehensions and generator expressions

Day 10-11: Strings and File I/O
- String manipulation and methods
- Reading from and writing to files

Day 12-13: Object-Oriented Programming (OOP)
- Classes and objects
- Inheritance, polymorphism, encapsulation

Day 14: Practice Day
- Solve intermediate problems on coding platforms

### Week 3: Introduction to Data Structures

Day 15-16: Arrays and Linked Lists
- Understanding arrays and their operations
- Singly and doubly linked lists

Day 17-18: Stacks and Queues
- Implementation and applications of stacks
- Implementation and applications of queues

Day 19-20: Recursion
- Basics of recursion and solving problems using recursion
- Recursive vs iterative solutions

Day 21: Practice Day
- Solve problems related to arrays, linked lists, stacks, and queues

### Week 4: Fundamental Algorithms

Day 22-23: Sorting Algorithms
- Bubble sort, selection sort, insertion sort
- Merge sort and quicksort

Day 24-25: Searching Algorithms
- Linear search and binary search
- Applications and complexity analysis

Day 26-27: Hashing
- Hash tables and hash functions
- Collision resolution techniques

Day 28: Practice Day
- Solve problems on sorting, searching, and hashing

### Week 5: Advanced Data Structures

Day 29-30: Trees
- Binary trees, binary search trees (BST)
- Tree traversals (in-order, pre-order, post-order)

Day 31-32: Heaps and Priority Queues
- Understanding heaps (min-heap, max-heap)
- Implementing priority queues using heaps

Day 33-34: Graphs
- Representation of graphs (adjacency matrix, adjacency list)
- Depth-first search (DFS) and breadth-first search (BFS)

Day 35: Practice Day
- Solve problems on trees, heaps, and graphs

### Week 6: Advanced Algorithms

Day 36-37: Dynamic Programming
- Introduction to dynamic programming
- Solving common DP problems (e.g., Fibonacci, knapsack)

Day 38-39: Greedy Algorithms
- Understanding greedy strategy
- Solving problems using greedy algorithms

Day 40-41: Graph Algorithms
- Dijkstraโ€™s algorithm for shortest path
- Kruskalโ€™s and Primโ€™s algorithms for minimum spanning tree

Day 42: Practice Day
- Solve problems on dynamic programming, greedy algorithms, and advanced graph algorithms

### Week 7: Problem Solving and Optimization

Day 43-44: Problem-Solving Techniques
- Backtracking, bit manipulation, and combinatorial problems

Day 45-46: Practice Competitive Programming
- Participate in contests on platforms like Codeforces or CodeChef

Day 47-48: Mock Interviews and Coding Challenges
- Simulate technical interviews
- Focus on time management and optimization

Day 49: Review and Revise
- Go through notes and previously solved problems
- Identify weak areas and work on them

### Week 8: Final Stretch and Project

Day 50-52: Build a Project
- Use your knowledge to build a substantial project in Python involving DSA concepts

Day 53-54: Code Review and Testing
- Refactor your project code
- Write tests for your project

Day 55-56: Final Practice
- Solve problems from previous contests or new challenging problems

Day 57-58: Documentation and Presentation
- Document your project and prepare a presentation or a detailed report

Day 59-60: Reflection and Future Plan
- Reflect on what you've learned
- Plan your next steps (advanced topics, more projects, etc.)

Best DSA RESOURCES: https://topmate.io/coding/886874

Credits: https://t.me/free4unow_backup

ENJOY LEARNING ๐Ÿ‘๐Ÿ‘
โค11๐Ÿฅฐ1
Pandas-Cheat-Sheet.pdf
2.7 MB
This cheat sheetโ€”part of our Complete Guide to #NumPy, #pandas, and #DataVisualizationโ€”offers a handy reference for essential pandas commands, focused on efficient #datamanipulation and analysis. Using examples from the Fortune 500 Companies #Dataset, it covers key pandas operations such as reading and writing data, selecting and filtering DataFrame values, and performing common transformations.

You'll find easy-to-follow examples for grouping, sorting, and aggregating data, as well as calculating statistics like mean, correlation, and summary statistics. Whether you're cleaning datasets, analyzing trends, or visualizing data, this cheat sheet provides concise instructions to help you navigate pandasโ€™ powerful functionality.

Designed to be practical and actionable, this guide ensures you can quickly apply pandasโ€™ versatile data manipulation tools in your workflow.
โค9๐Ÿฅฐ3
10 Steps to Landing a High Paying Job in Data Analytics

1. Learn SQL - joins & windowing functions is most important

2. Learn Excel- pivoting, lookup, vba, macros is must

3. Learn Dashboarding on POWER BI/ Tableau

4. โ Learn Python basics- mainly pandas, numpy, matplotlib and seaborn libraries

5. โ Know basics of descriptive statistics

6. โ With AI/ copilot integrated in every tool, know how to use it and add to your projects

7. โ Have hands on any 1 cloud platform- AZURE/AWS/GCP

8. โ WORK on atleast 2 end to end projects and create a portfolio of it

9. โ Prepare an ATS friendly resume & start applying

10. โ Attend interviews (you might fail in first 2-3 interviews thats fine),make a list of questions you could not answer & prepare those.

Give more interview to boost your chances through consistent practice & feedback ๐Ÿ˜„๐Ÿ‘
โค6๐Ÿ‘4๐Ÿฅฐ2
๐Ÿš€ Roadmap to Master Data Analytics in 50 Days! ๐Ÿ“Š๐Ÿ“ˆ

๐Ÿ“… Week 1โ€“2: Foundations
๐Ÿ”น Day 1โ€“3: What is Data Analytics? Tools overview
๐Ÿ”น Day 4โ€“7: Excel/Google Sheets (formulas, pivot tables, charts)
๐Ÿ”น Day 8โ€“10: SQL basics (SELECT, WHERE, JOIN, GROUP BY)

๐Ÿ“… Week 3โ€“4: Programming Data Handling
๐Ÿ”น Day 11โ€“15: Python for data (variables, loops, functions)
๐Ÿ”น Day 16โ€“20: Pandas, NumPy โ€“ data cleaning, filtering, aggregation

๐Ÿ“… Week 5โ€“6: Visualization EDA
๐Ÿ”น Day 21โ€“25: Data visualization (Matplotlib, Seaborn)
๐Ÿ”น Day 26โ€“30: Exploratory Data Analysis โ€“ ask questions, find trends

๐Ÿ“… Week 7โ€“8: BI Tools Advanced Skills
๐Ÿ”น Day 31โ€“35: Power BI / Tableau โ€“ dashboards, filters, DAX
๐Ÿ”น Day 36โ€“40: Real-world case studies โ€“ sales, HR, marketing data

๐ŸŽฏ Final Stretch: Projects Career Prep
๐Ÿ”น Day 41โ€“45: Capstone projects (end-to-end analysis + report)
๐Ÿ”น Day 46โ€“48: Resume, GitHub portfolio, LinkedIn optimization
๐Ÿ”น Day 49โ€“50: Mock interviews + SQL + Excel + scenario questions

๐Ÿ’ฌ Tap โค๏ธ for more!
โค22๐Ÿ‘3
If you are trying to transition into the data analytics domain and getting started with SQL, focus on the most useful concept that will help you solve the majority of the problems, and then try to learn the rest of the topics:

๐Ÿ‘‰๐Ÿป Basic Aggregation function:
1๏ธโƒฃ AVG
2๏ธโƒฃ COUNT
3๏ธโƒฃ SUM
4๏ธโƒฃ MIN
5๏ธโƒฃ MAX

๐Ÿ‘‰๐Ÿป JOINS
1๏ธโƒฃ Left
2๏ธโƒฃ Inner
3๏ธโƒฃ Self (Important, Practice questions on self join)

๐Ÿ‘‰๐Ÿป Windows Function (Important)
1๏ธโƒฃ Learn how partitioning works
2๏ธโƒฃ Learn the different use cases where Ranking/Numbering Functions are used? ( ROW_NUMBER,RANK, DENSE_RANK, NTILE)
3๏ธโƒฃ Use Cases of LEAD & LAG functions
4๏ธโƒฃ Use cases of Aggregate window functions

๐Ÿ‘‰๐Ÿป GROUP BY
๐Ÿ‘‰๐Ÿป WHERE vs HAVING
๐Ÿ‘‰๐Ÿป CASE STATEMENT
๐Ÿ‘‰๐Ÿป UNION vs Union ALL
๐Ÿ‘‰๐Ÿป LOGICAL OPERATORS

Other Commonly used functions:
๐Ÿ‘‰๐Ÿป IFNULL
๐Ÿ‘‰๐Ÿป COALESCE
๐Ÿ‘‰๐Ÿป ROUND
๐Ÿ‘‰๐Ÿป Working with Date Functions
1๏ธโƒฃ EXTRACTING YEAR/MONTH/WEEK/DAY
2๏ธโƒฃ Calculating date differences

๐Ÿ‘‰๐ŸปCTE
๐Ÿ‘‰๐ŸปViews & Triggers (optional)

Here is an amazing resources to learn & practice SQL: https://bit.ly/3FxxKPz

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

Hope it helps :)
โค16
๐Ÿ”ฐ Local vs global variable in python
โค11
๐Ÿ”ฅ Python Case Study-Based Interview Q&A (Top 5 ๐Ÿ”ฅ)

๐Ÿ“Š Q1. Sales Drop Analysis
Scenario: Sales dropped last month. How will you analyze?

๐Ÿ‘‰ Check monthly trends using groupby()
๐Ÿ‘‰ Compare MoM performance
๐Ÿ‘‰ Identify drop by region/product
๐Ÿ‘‰ Drill down to root cause

๐Ÿ“Š Q2. Customer Segmentation

Scenario: Segment customers based on purchase behaviour

๐Ÿ‘‰ Group by customer ID
๐Ÿ‘‰ Calculate total spend / frequency
๐Ÿ‘‰ Create segments (High, Medium, Low)
๐Ÿ‘‰ Useful for business decisions

๐Ÿ“Š Q3. Data Cleaning Case
Scenario: Dataset has missing values, duplicates, inconsistent formats

๐Ÿ‘‰ Handle missing โ†’ fillna()/dropna()
๐Ÿ‘‰ Remove duplicates โ†’ drop_duplicates()
๐Ÿ‘‰ Standardize formats (dates, text)
๐Ÿ‘‰ Ensure clean dataset before analysis

๐Ÿ“Š Q4. Top Performing Products
Scenario: Find best-selling products

๐Ÿ‘‰ groupby(product) + sum(sales)
๐Ÿ‘‰ Sort descending
๐Ÿ‘‰ Use head() for top results
๐Ÿ‘‰ Can also analyze category-wise

๐Ÿ“Š Q5. Conversion Rate Analysis
Scenario: Calculate conversion rate from visits to purchases

๐Ÿ‘‰ Conversion Rate = purchases / total visits
๐Ÿ‘‰ Aggregate data properly
๐Ÿ‘‰ Analyze by channel/source
๐Ÿ‘‰ Helps optimize marketing

๐Ÿ”ฅ React with โ™ฅ๏ธ for more case-study questions
โค15
Excel Basics for Data Analytics

Excel sits at the start of most analysis work.

What you use Excel for
โ€ข Cleaning raw data
โ€ข Exploring patterns
โ€ข Quick summaries for teams

Core concepts you must know
โ€ข Data setup
โ€“ Freeze header row. View โ†’ Freeze Top Row.
โ€“ Convert range to table. Ctrl + T.
โ€“ Use proper headers. No merged cells. One value per cell.

โ€ข Data cleaning
โ€“ Remove duplicates. Data โ†’ Remove Duplicates.
โ€“ Trim extra spaces. =TRIM(A2)
โ€“ Convert text to numbers. =VALUE(A2)
โ€“ Fix date format. Format Cells โ†’ Date.
โ€“ Handle blanks. Filter blanks, fill or delete.
โ€“ Find and replace. Ctrl + H.

โ€ข Essential formulas
โ€“ Math and counts
โ–ช SUM. =SUM(A2:A100)
โ–ช AVERAGE. =AVERAGE(A2:A100)
โ–ช MIN. =MIN(A2:A100)
โ–ช MAX. =MAX(A2:A100)
โ–ช COUNT. Counts numbers.
โ–ช COUNTA. Counts non blanks.
โ–ช COUNTBLANK. Counts blanks.
โ€“ Conditional formulas
โ–ช IF. =IF(A2>5000,"High","Low")
โ–ช IFS. Multiple conditions.
โ–ช AND. =AND(A2>5000,B2="West")
โ–ช OR. =OR(A2>5000,A2<1000)
โ€“ Lookup formulas
โ–ช XLOOKUP. =XLOOKUP(A2,Sheet2!A:A,Sheet2!B:B)
โ–ช VLOOKUP. Old but common.
โ–ช INDEX + MATCH. Powerful alternative.
โ€“ Text formulas
โ–ช LEFT. =LEFT(A2,4)
โ–ช RIGHT. =RIGHT(A2,2)
โ–ช MID. =MID(A2,2,3)
โ–ช LEN. =LEN(A2)
โ–ช CONCAT or TEXTJOIN.
โ–ช LOWER, UPPER, PROPER.
โ€“ Date formulas
โ–ช TODAY. Current date.
โ–ช NOW. Date and time.
โ–ช YEAR, MONTH, DAY.
โ–ช DATEDIF. Date difference.
โ–ช EOMONTH. Month end.

โ€ข Sorting and filtering
โ€“ Sort by multiple columns.
โ€“ Filter by value, color, condition.
โ€“ Top 10 filter for quick insights.

โ€ข Conditional formatting
โ€“ Highlight duplicates.
โ€“ Color scales for trends.
โ€“ Rules for thresholds. Example. Sales > 10000 in green.

โ€ข Pivot tables
โ€“ Insert โ†’ PivotTable.
โ€“ Rows. Category or Product.
โ€“ Values. Sum, Count, Average.
โ€“ Filters. Date, Region.
โ€“ Refresh after data update.

โ€ข Charts you must know
โ€“ Column. Comparison.
โ€“ Bar. Ranking.
โ€“ Line. Trends over time.
โ€“ Pie. Share or percentage.
โ€“ Combo. Actual vs target.

โ€ข Data validation
โ€“ Dropdown list. Data โ†’ Data Validation โ†’ List.
โ€“ Prevent wrong entries.

โ€ข Useful shortcuts
โ€“ Ctrl + Arrow. Jump data.
โ€“ Ctrl + Shift + Arrow. Select range.
โ€“ Ctrl + 1. Format cells.
โ€“ Ctrl + L. Apply filter.
โ€“ Alt + =. Auto sum.
โ€“ Ctrl + Z / Y. Undo redo.

โ€ข Common analyst mistakes to avoid
โ€“ Merged cells.
โ€“ Hard coded totals.
โ€“ Mixed data types in one column.
โ€“ No backup before cleaning.

โ€ข Daily practice task
โ€“ Download any sales CSV.
โ€“ Clean it.
โ€“ Build one pivot table.
โ€“ Create one chart.

Excel Resources: https://whatsapp.com/channel/0029VaifY548qIzv0u1AHz3i

Data Analytics Roadmap: https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02/1354

Double Tap โ™ฅ๏ธ For More
โค13
๐Ÿ”ฅ Pandas Scenario-Based Interview Question ๐Ÿผ

๐Ÿ“Š Scenario:

You have an orders dataset with:
order_id
customer_id
order_date
category
sales

๐ŸŽฏ Task:

Find the top-selling category for each month based on total sales.

โœ… Pandas Solution:

import pandas as pd

# Convert to datetime
df['order_date'] = pd.to_datetime(df['order_date'])

# Extract month
df['month'] = df['order_date'].dt.strftime('%b-%Y')

# Total sales by month & category
sales_summary = (
df.groupby(['month', 'category'])['sales']
.sum()
.reset_index()
)

# Rank categories within each month
sales_summary['rank'] = (
sales_summary.groupby('month')['sales']
.rank(method='dense', ascending=False)
)

# Top category per month
result = sales_summary[sales_summary['rank'] == 1]

print(result)

๐Ÿ’ก Concepts Tested:

โœ”๏ธ groupby()
โœ”๏ธ Date handling
โœ”๏ธ Aggregation
โœ”๏ธ Ranking within groups

React โ™ฅ๏ธ for more interview questions
โค9
Expand your job search to increase your chances of becoming a data analyst.

Here are alternative roles to explore:

1. ๐—•๐˜‚๐˜€๐—ถ๐—ป๐—ฒ๐˜€๐˜€ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜€๐˜: Focuses on using data to improve business processes and decision-making.
   
2. ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐˜€ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜€๐˜: Specializes in analyzing operational data to optimize efficiency and performance.
   
3. ๐— ๐—ฎ๐—ฟ๐—ธ๐—ฒ๐˜๐—ถ๐—ป๐—ด ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜€๐˜: Uses data to drive marketing strategies and measure campaign effectiveness.
   
4. ๐—™๐—ถ๐—ป๐—ฎ๐—ป๐—ฐ๐—ถ๐—ฎ๐—น ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜€๐˜: Analyzes financial data to support investment decisions and financial planning.
   
5. ๐—ฃ๐—ฟ๐—ผ๐—ฑ๐˜‚๐—ฐ๐˜ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜€๐˜: Evaluates product performance and user data to help product development.
   
6. ๐—ฅ๐—ฒ๐˜€๐—ฒ๐—ฎ๐—ฟ๐—ฐ๐—ต ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜€๐˜: Conducts data-driven research to support strategic decisions and policy development.
   
7. ๐—•๐—œ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜€๐˜: Transforms data into actionable business insights through reporting and visualization.
   
8. ๐—ค๐˜‚๐—ฎ๐—ป๐˜๐—ถ๐˜๐—ฎ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜€๐˜: Utilizes statistical and mathematical models to analyze large datasets, often in finance.
   
9. ๐—–๐˜‚๐˜€๐˜๐—ผ๐—บ๐—ฒ๐—ฟ ๐—œ๐—ป๐˜€๐—ถ๐—ด๐—ต๐˜๐˜€ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜€๐˜: Analyzes customer data to improve customer experience and drive retention.
   
10. ๐——๐—ฎ๐˜๐—ฎ ๐—–๐—ผ๐—ป๐˜€๐˜‚๐—น๐˜๐—ฎ๐—ป๐˜: Provides expert advice on data strategies, data management, and analytics to organizations.
   
11. ๐—ฆ๐˜‚๐—ฝ๐—ฝ๐—น๐˜† ๐—–๐—ต๐—ฎ๐—ถ๐—ป ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜€๐˜: Analyzes supply chain data to optimize logistics, reduce costs, and improve efficiency.
   
12. ๐—›๐—ฅ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜€๐˜: Uses data to improve human resources processes, from recruitment to employee retention and performance management.

Data Analyst Roadmap ๐Ÿ‘‡๐Ÿ‘‡
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02

Hope this helps you ๐Ÿ˜Š
โค8
โœ… Python Basics for Data Analytics ๐Ÿ“Š๐Ÿ

Python is one of the most in-demand languages for data analytics due to its simplicity, flexibility, and powerful libraries. Here's a detailed guide to get you started with the basics:

๐Ÿง  1. Variables Data Types
You use variables to store data.

name = "Alice"        # String  
age = 28 # Integer
height = 5.6 # Float
is_active = True # Boolean

Use Case: Store user details, flags, or calculated values.

๐Ÿ”„ 2. Data Structures

โœ… List โ€“ Ordered, changeable
fruits = ['apple', 'banana', 'mango']  
print(fruits[0]) # apple

โœ… Dictionary โ€“ Key-value pairs
person = {'name': 'Alice', 'age': 28}  
print(person['name']) # Alice

โœ… Tuple Set
Tuples = immutable, Sets = unordered unique

โš™๏ธ 3. Conditional Statements
score = 85  
if score >= 90:
print("Excellent")
elif score >= 75:
print("Good")
else:
print("Needs improvement")

Use Case: Decision making in data pipelines

๐Ÿ” 4. Loops
For loop
for fruit in fruits:  
print(fruit)


While loop
count = 0  
while count < 3:
print("Hello")
count += 1

๐Ÿ”ฃ 5. Functions
Reusable blocks of logic

def add(x, y):  
return x + y

print(add(10, 5)) # 15

๐Ÿ“‚ 6. File Handling
Read/write data files

with open('data.txt', 'r') as file:  
content = file.read()
print(content)

๐Ÿงฐ 7. Importing Libraries
import pandas as pd  
import numpy as np
import matplotlib.pyplot as plt

Use Case: These libraries supercharge Python for analytics.

๐Ÿงน 8. Real Example: Analyzing Data
import pandas as pd  

df = pd.read_csv('sales.csv') # Load data
print(df.head()) # Preview

# Basic stats
print(df.describe())
print(df['Revenue'].mean())


๐ŸŽฏ Why Learn Python for Data Analytics?
โœ… Easy to learn
โœ… Huge library support (Pandas, NumPy, Matplotlib)
โœ… Ideal for cleaning, exploring, and visualizing data
โœ… Works well with SQL, Excel, APIs, and BI tools

Python Programming: https://whatsapp.com/channel/0029VaiM08SDuMRaGKd9Wv0L

๐Ÿ’ฌ Double Tap โค๏ธ for more!
โค5๐Ÿ‘1
๐Ÿ”ฐ Piechart using matplotlib in Python
โค4
Data Visualization with Pandas
โค6๐Ÿ‘4๐Ÿ‘1