mayankjoin3

scaled marks

May 7th, 2026 (edited)
53
0
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.67 KB | None | 0 0
  1. import pandas as pd
  2. from sklearn.preprocessing import MinMaxScaler
  3.  
  4. # ---------- CONFIG ----------
  5. INPUT_FILE = "grade.csv"
  6. OUTPUT_FILE = "grade_scaled.csv"
  7.  
  8. # ---------- GRADE RANGES ----------
  9. GRADE_RANGES = {
  10.     "AA": (91, 100),
  11.     "AB": (81, 90),
  12.     "BB": (71, 80),
  13.     "BC": (61, 70),
  14.     "CC": (51, 60),
  15.     "CD": (41, 50),
  16.     "DD": (31, 40),
  17.     "I": (0, 30),
  18. }
  19.  
  20. # ---------- READ CSV ----------
  21. df = pd.read_csv(INPUT_FILE)
  22.  
  23. # Clean column names
  24. df.columns = [c.strip() for c in df.columns]
  25.  
  26. # Clean Grade column
  27. df["Grade"] = df["Grade"].astype(str).str.strip().str.upper()
  28.  
  29. # Convert Sum to numeric
  30. df["Sum"] = pd.to_numeric(df["Sum"], errors="coerce")
  31.  
  32. # ---------- SORT BY SUM ----------
  33. df = df.sort_values(by="Sum", ascending=False).reset_index(drop=True)
  34.  
  35. # ---------- SCALE WITHIN EACH GRADE ----------
  36. df["Scaled"] = 0.0
  37.  
  38. for grade, (low, high) in GRADE_RANGES.items():
  39.     # Subset for this grade
  40.     mask = df["Grade"] == grade
  41.     subset = df.loc[mask, "Sum"]
  42.  
  43.     if len(subset) == 0:
  44.         continue
  45.  
  46.     # If all values same → assign midpoint
  47.     if subset.min() == subset.max():
  48.         scaled_vals = [round((low + high) / 2, 2)] * len(subset)
  49.  
  50.     else:
  51.         scaler = MinMaxScaler(feature_range=(low, high))
  52.         scaled_vals = scaler.fit_transform(subset.values.reshape(-1, 1)).flatten()
  53.         scaled_vals = [round(x, 2) for x in scaled_vals]
  54.  
  55.     df.loc[mask, "Scaled"] = scaled_vals
  56.  
  57. # ---------- SAVE ----------
  58. df.to_csv(OUTPUT_FILE, index=False)
  59.  
  60. print(f"Scaled file saved as: {OUTPUT_FILE}")
  61.  
  62. #Sl,Roll,Name,Sum,Grade
  63. #1,1301AI04,Sukar,99.296,AA
  64. #2,1301AI30,M Singh,96.509,AA
  65. #3,1301AI16,K K,91.364,AA
Advertisement
Comments
  • User was banned
  • User was banned
  • Remi00
    14 hours
    # CSS 0.83 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://drive.google.com/file/d/1cvQPOZ7JecI0L6lqdIzIHJbHQBiDRT4U/view?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
Add Comment
Please, Sign In to add comment