728x90
parsing-dates
-
캐글 data_cleaning/03-parsing-dates<Kaggle-Course> 2023. 3. 16. 18:24
date_format = '%m/%d/%Y' earthquakes.loc[indices,'Date'] = pd.to_datetime(earthquakes.loc[indices,'Date']) \ .dt.strftime(date_format) earthquakes['date_parsed'] = pd.to_datetime(earthquakes['Date']) day_of_month_earthquakes = earthquakes['date_parsed'].dt.day date_lengths = earthquakes.Date.str.len() date_lengths.value_counts()