तिथियों से फीचर बनाना
एक और फीचर इंजीनियरिंग कार्य है month और year निकालना. यह कार्य ufo डेटासेट के date कॉलम पर कीजिए.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Python में Machine Learning के लिए Preprocessing
अभ्यास निर्देश
dateकॉलम का.head()प्रिंट करें.dateकॉलम का month ऐट्रिब्यूट प्राप्त करें.dateकॉलम का year ऐट्रिब्यूट प्राप्त करें.date,month, औरyearकॉलम के.head()पर एक नज़र डालें.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Look at the first 5 rows of the date column
print(____)
# Extract the month from the date column
ufo["month"] = ufo["date"].____
# Extract the year from the date column
ufo["year"] = ufo["date"].____
# Take a look at the head of all three columns
print(____)