TGViewer
Channel Public Channel
Python Learning

Python Learning

@python_bds

Python learning resources

Beginner to advanced Python guides, cheatsheets, books and projects.

For data science, backend and automation.
Join πŸ‘‰ https://rebrand.ly/bigdatachannels

DMCA: @disclosure_bds
Contact: @mldatascientist
Subscribers
5.75K
Photos
582
Videos
2
Links
130

Showing posts older than #938 Β· Back to latest

Older Posts 19 shown
Post #937 1.28K
Excel vs SQL vs Python (pandas):

1️⃣ Filtering Data
↳ Excel: =FILTER(A2:D100, B2:B100>50) (Excel 365 users)
↳ SQL: SELECT * FROM table WHERE column > 50;
↳ Python: df_filtered = df[df['column'] > 50]

2️⃣ Sorting Data
↳ Excel: Data β†’ Sort (or =SORT(A2:A100, 1, TRUE))
↳ SQL: SELECT * FROM table ORDER BY column ASC;
↳ Python: df_sorted = df.sort_values(by="column")

3️⃣ Counting Rows
↳ Excel: =COUNTA(A:A)
↳ SQL: SELECT COUNT(*) FROM table;
↳ Python: row_count = len(df)

4️⃣ Removing Duplicates
↳ Excel: Data β†’ Remove Duplicates
↳ SQL: SELECT DISTINCT * FROM table;
↳ Python: df_unique = df.drop_duplicates()

5️⃣ Joining Tables
↳ Excel: Power Query β†’ Merge Queries (or VLOOKUP/XLOOKUP)
↳ SQL: SELECT * FROM table1 JOIN table2 ON table1.id = table2.id;
↳ Python: df_merged = pd.merge(df1, df2, on="id")

6️⃣ Ranking Data
↳ Excel: =RANK.EQ(A2, $A$2:$A$100)
↳ SQL: SELECT column, RANK() OVER (ORDER BY column DESC) AS rank FROM table;
↳ Python: df["rank"] = df["column"].rank(method="min", ascending=False)

7️⃣ Moving Average Calculation
↳ Excel: =AVERAGE(B2:B4) (manually for rolling window)
↳ SQL: SELECT date, AVG(value) OVER (ORDER BY date ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) AS moving_avg FROM table;
↳ Python: df["moving_avg"] = df["value"].rolling(window=3).mean()

8️⃣ Running Total
↳ Excel: =SUM($B$2:B2) (drag down)
↳ SQL: SELECT date, SUM(value) OVER (ORDER BY date) AS running_total FROM table;
↳ Python: df["running_total"] = df["value"].cumsum()
  • ❀ 3
Post #936 933
Did You Know❓

Python's int type has no size limit (unlike many languages with fixed-size integers like 32-bit or 64-bit). It can handle arbitrarily large integers, constrained only by your system's memory. This is due to Python's internal use of a variable-length encoding for integers.
  • πŸ”₯ 2
Post #935 1.07K
  • ❀ 1
  • πŸ”₯ 1
Post #934 1.24K
Roadmap for data analyst
  • ❀ 3
  • πŸ”₯ 1
Post #933 1.18K
  • πŸ”₯ 1
Post #932 1.38K
  • ❀ 1
  • πŸ”₯ 1
Post #931 1.42K
  • πŸ”₯ 1
Post #930 1.64K
LIST METHODS IN PYTHON
  • ❀ 4
Post #929 1.58K
BEGINNERS GUIDE ON CHATGPT
  • ❀ 6
Post #928 2.33K
PYTHON CHEAT SHEET
  • ❀ 5
Post #927 1.46K
DATA TYPES IN PYTHON
  • ❀ 4
Post #925 2.2K
A DETAILED PYTHON CHEAT SHEET
  • ❀ 2
Post #924 1.43K
LOVE USING PYTHON CODE
  • ❀ 2
Post #923 1.4K
PYTHON OPERATORS
  • πŸ‘ 4
  • ❀ 1
Post #922 1.42K
Python functions
  • πŸ‘ 5
  • ❀ 1
Post #921 1.49K
PYTHON TRICK
  • ❀ 6
  • πŸ‘ 1
Post #920 1.6K
Dictionary Method in Python
  • ❀ 2
  • πŸ‘ 2
Post #919 2.43K
Python Cheatsheet
  • ❀ 1
  • πŸ‘ 1
Post #918 1.41K
POWERFUL ONE-LINER IN PYTHON
  • πŸ‘ 5
Older posts β†’
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 β†’