Python Forum
drop rows that doesnt matched
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
drop rows that doesnt matched
#7
(Oct-28-2019, 10:55 AM)snippsat Wrote:
>>> import pandas as pd

>>> df = pd.DataFrame({0: ['09.05.2017 13:56', '1494331179', '1494331625', '09.05.2017 14:11', '944006550', '03.07.2017 16:50'],1: range(6)})
>>> pd.to_datetime(df[0], format='%d.%m.%Y %H:%M', errors='coerce')
0   2017-05-09 13:56:00
1                   NaT
2                   NaT
3   2017-05-09 14:11:00
4                   NaT
5   2017-07-03 16:50:00
Name: 0, dtype: datetime64[ns]
You are missing %H:%M

Bonkself

Thks ... sometimes I think the mistake is too big without taking the time to analyze my code. sorry about that.
Reply


Messages In This Thread
drop rows that doesnt matched - by karlito - Oct-25-2019, 05:58 PM
RE: drop rows that doesnt matched - by snippsat - Oct-26-2019, 11:57 AM
RE: drop rows that doesnt matched - by karlito - Oct-26-2019, 02:14 PM
RE: drop rows that doesnt matched - by snippsat - Oct-26-2019, 04:51 PM
RE: drop rows that doesnt matched - by karlito - Oct-28-2019, 10:19 AM
RE: drop rows that doesnt matched - by snippsat - Oct-28-2019, 10:55 AM
RE: drop rows that doesnt matched - by karlito - Oct-28-2019, 12:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Drop rows if a set of columns has a value dervast 1 1,954 Sep-12-2019, 04:18 PM
Last Post: sd_0912
  Drop rows from data with zero value Devilish 3 3,697 Dec-27-2018, 02:06 AM
Last Post: Devilish

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020