TGTGInsighttelegram intelligenceLIVE / telegram public index
← Data Analytics
Data Analytics avatar

TGINSIGHT POST

Post #1281

@sqlspecialist

Data Analytics

Views7,070Post view count
PostedMar 2803/28/2025, 05:37 AM
Post content

Post content

Python for Data Analytics - Quick Cheatsheet with Cod e Example🚀 1️⃣Data Manipulation with Pandas import pandas as pd df = pd.read_csv("data.csv") df.to_excel("output.xlsx") df.head() df.info() df.describe() df[df["sales"] > 1000] df[["name", "price"]] df.fillna(0, inplace=True) df.dropna(inplace=True) 2️⃣Numerical Operations with NumPy import numpy as np arr = np.array([1, 2, 3, 4]) print(arr.shape) np.mean(arr) np.median(arr) np.std(arr) 3️⃣Data Visualization with Matplotlib & Seaborn import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4], [10, 20, 30, 40]) plt.bar(["A", "B", "C"], [5, 15, 25]) plt.show() import seaborn as sns sns.heatmap(df.corr(), annot=True) sns.boxplot(x="category", y="sales", data=df) plt.show() 4️⃣Exploratory Data Analysis (EDA) df.isnull().sum() df.corr() sns.histplot(df["sales"], bins=30) sns.boxplot(y=df["price"]) 5️⃣Working with Databases (SQL + Python) import sqlite3 conn = sqlite3.connect("database.db") df = pd.read_sql("SELECT * FROM sales", conn) conn.close() cursor = conn.cursor() cursor.execute("SELECT AVG(price) FROM products") result = cursor.fetchone() print(result) React with ❤️ for more Share with credits: https://t.me/sqlspecialist Hope it helps :)