Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Machine Learning by (33.1k points)

I use pandas.to_datetime to parse the dates in my data. Pandas by default represent the dates with  datetime64[ns] even though the dates are all daily only. I wonder whether there is an elegant/clever way to convert the dates to datetime.date or datetime64[D] so that, when I write the data to CSV, the dates are not appended with 00:00:00. I know I can convert the type manually element-by-element:

[dt.to_datetime().date() for dt in df.dates]

But this is really slow since I have many rows and it sort of defeats the purpose of using pandas.to_datetime. Is there a way to convert the dtype of the entire column at once? Or alternatively, does pandas.to_datetime support a precision specification so that I can get rid of the time part while working with daily data?

1 Answer

0 votes
by (33.1k points)

In your problem, you are not using any function or parameter which can directly help the Android app to maintain the size of the image by itself.

So I prefer you to use the YOLO detection function in your code to solve this problem. There is a parameter in YOLO detection named ’MAINTAIN_ASPECT’. You need to set this parameter at TRUE to handle image size by itself. 

I hope this solution will debug your code.

Visit here if you wish to learn about Python Pandas Tutorial.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...