Get your API key

Lesson 2 mein se 5

Ginne se pehle saaf karo, cleaning log ke saath

Rs wale text amounts, dd-mm-yyyy dates, states ki spellings aur duplicates theek karo, har step ke pehle aur baad ki rows likh kar.

8 min Login karke kholo
Ek baar mein ek step, page palatne jaisa.

Is lesson ke end tak aapke paas ek saaf sales file hogi, ek cleaning log jo har step ke pehle aur baad ki rows dikhata hai, aur har hatayi gayi row ki saved list.

Aapko chahiye: lesson 1 wala workbench, apni anonymised sales file ya practice_sales.csv, aur check karne ke liye Excel ya Google Sheets · Time: 8 minute

  1. Hamara example sales_q2.csv hai: Ahmedabad ke ek lighting distributor ke July se September 2026 tak ke 4,812 invoices. Aapki file practice wali ho sakti hai; steps same hain.

    Cleaning se pehle AI ko poore session ke rules de do. Do baatein sabse zaroori hain:

    • Raw file raw rahegi. Original file kabhi nahi badlegi. Saaf data nayi file mein jaayega. Agent ke saath original ko project ke andar raw folder mein rakho; Colab mein original woh copy hai jo aapke laptop par hai.
    • Cleaning log. Ek chhoti table jismein har step ek line likhta hai: kya badla, pehle kitni rows, baad mein kitni, aur saboot. End mein yeh aapko, aur aapke manager ko, bata deta hai ki data ke saath exactly kya hua.
    Prompt · ise apne AI agent mein paste karo
    We are going to clean [sales_q2.csv] step by step. Rules for this whole session:
    1. Never change or overwrite [sales_q2.csv]. Write the cleaned data to sales_clean.csv.
    2. Do one step at a time, and wait for my OK before the next step.
    3. After every step, print: step number, what changed, rows before, rows after, number of cells changed, and 3 example rows before and after.
    4. Add the same line to cleaning_log.csv (columns: step, what_changed, rows_before, rows_after, cells_changed, note).
    5. Never drop a row without saving the dropped rows to a file and telling me the file name.
    6. Never guess a value. If you cannot convert or map something, list it and ask me.
    Start by confirming the row count of the raw file. Do not clean anything yet.
    Chaar steps wali cleaning log table. Step 1 Rs text ko numbers banata hai, pehle aur baad 4,812 rows, 3 fail hue aur list kiye. Step 2 dates ko dd-mm-yyyy padhta hai, range 01-07 se 30-09. Step 3 meri table se state names map karta hai, 41 cells. Step 4 exact duplicates hatata hai, 4,812 rows 4,775 ho jaati hain, 37 rows removed.csv mein save. Peeli patti kehti hai raw file kabhi nahi badli aur har gayi hui row ka kaaran aur file hai.
    Har step ki ek line. Rows sirf wahin ghatti hain jahan aapne decide kiya.
    Kyun?

    Log ke bina saaf file ek black box hai. Log ke saath koi bhi dekh sakta hai ki 37 rows hati, kyun hati, aur kahan rakhi hain, aur aap koi bhi step undo kar sakte ho.

Baaki lesson padhne ke liye free login karo

Har lesson free hai. Free account se saare lessons khul jaate hain aur aapki progress save hoti hai.

Is lesson mein aage:

  1. Amounts: "Rs 1,24,500" text hai, number nahi
  2. Dates: format batao, guess mat karne do
  3. State names: aapki approve ki hui mapping table
  4. Duplicates: rule ek insaan decide karta hai
  5. Recap