Python Pandas Sales Data Analysis Project in Hindi
🐼 Python Pandas Sales Data Analysis
Project in Hindi — Beginners के लिए
आज के दौर में Data Science की माँग बहुत तेज़ी से बढ़ रही है। हर छोटी-बड़ी कंपनी चाहती है कि उनके Products, Sales और Customers का Data सही तरीके से Analyze हो। लेकिन इसके लिए एक Powerful Tool चाहिए — और वो Tool है Python Pandas Library।
अगर आप एक Student हैं और Python Course सीख रहे हैं, तो यह Pandas Project for Beginners आपके लिए बिल्कुल सही है। इस पोस्ट को पढ़ने के बाद आप खुद एक पूरा Data Analysis Project बना सकेंगे।
🎯 Project Goal — हम क्या सीखेंगे?
इस Sales Data Analysis Python Project में हम एक Simple CSV File का उपयोग करेंगे। इस प्रोजेक्ट में हम सीखेंगे कि Python Pandas का उपयोग करके Sales Data Analysis कैसे किया जाता है। हम इन सवालों के जवाब निकालेंगे:
- Total Sales कितना है
- Best Selling Product कौन सा है
- Average Sales क्या है
- High Performing Products कैसे filter करें
यह Python Project in Hindi आपको न केवल Pandas की Basics सिखाएगा, बल्कि Real-World Data के साथ काम करने का अनुभव भी देगा।
📁 Step 1 — Sample Dataset (sales.csv)
CSV (Comma-Separated Values) File एक Simple Text File होती है जिसमें Data Rows और Columns में लिखा होता है — बिल्कुल Excel Sheet की तरह।
नीचे दिया Data Copy करके sales.csv नाम से Save करें:
Product,Sales A,100 B,150 C,200 A,120 B,180 C,220
| Product | Sales |
|---|---|
| A | 100 |
| B | 150 |
| C | 200 |
| A | 120 |
| B | 180 |
| C | 220 |
💻 Step-by-Step Python Code
अब हम Step-by-Step Python Code लिखेंगे। पहले सुनिश्चित करें कि आपके Computer में Python 3 और Pandas Install है। Terminal में pip install pandas Type करें। पूरी Guide के लिए हमारे Study Material Page पर जाएँ।
import pandas as pd df = pd.read_csv("sales.csv") print(df.head())
# Total Sales print("Total Sales:", df["Sales"].sum()) # Average Sales print("Average Sales:", df["Sales"].mean()) # Maximum Sale print("Max Sale:", df["Sales"].max())
# Group by product grouped = df.groupby("Product")["Sales"].sum() print(grouped)
print("Best Product:", grouped.idxmax())
high_sales = df[df["Sales"] > 150] print(high_sales)
| Index | Product | Sales |
|---|---|---|
| 2 | C | 200 ✓ |
| 4 | B | 180 ✓ |
| 5 | C | 220 ✓ |
* Condition है strictly > 150, इसलिए B=150 exclude होगा।
df = df.drop_duplicates() df["Sales"] = df["Sales"].fillna(df["Sales"].mean())
print(df.sort_values(by="Sales", ascending=False))
import pandas as pd df = pd.read_csv("sales.csv") # Total & average print("Total Sales:", df["Sales"].sum()) print("Average Sales:", df["Sales"].mean()) # Group by product grouped = df.groupby("Product")["Sales"].sum() print("\nSales by Product:") print(grouped) # Best product print("\nBest Product:", grouped.idxmax()) # High sales filter print("\nHigh Sales:") print(df[df["Sales"] > 150])
Average Sales: 161.66666666666666
Sales by Product:
Product
A 220
B 330
C 420
Name: Sales, dtype: int64
Best Product: C
High Sales:
Product Sales
2 C 200
4 B 180
5 C 220
📊 Output की जानकारी — Results समझें
कुल Sales 970 है। Product C सबसे आगे है — 420 की grouped Sales के साथ। Product B = 150 Filter में नहीं आया क्योंकि Condition strictly greater than है।
idxmax() Function ने हमें directly बता दिया कि Best Seller कौन है। यही Pandas Example in Hindi का Real Power है।
🚀 What You Learned
🌍 Real-Life Use Cases
🔚 Conclusion — आगे क्या करें?
आज हमने एक पूरा Python Pandas Tutorial in Hindi Complete किया — read_csv से लेकर sort_values तक।
अगर आप सच में Data Science में Career बनाना चाहते हैं, तो इस तरह के Hands-On Projects बनाते रहना बहुत ज़रूरी है। हर बड़ा Data Scientist एक बार Beginner था। 💪
और ऐसे Python Course और Study Material के लिए UPGK Online पर बने रहें।
❓ अक्सर पूछे जाने वाले सवाल (FAQ)
read_excel() Function से .xlsx Files पढ़ी जा सकती हैं। बस pip install openpyxl करें।pip install pandas Type करें। पूरी Installation Guide हमारे Study Material Page पर मिलेगी।UPGK Online से जुड़े रहें!
टिप्पणियाँ
एक टिप्पणी भेजें