Error after Mapping the Timestamp() to the column

Hello Team,

Can anyone help, why I am getting the map object, after mapping the invoice_date column with the Timestamp, and how can i correct it.

You are using python map function directly, this will return map object.
This need to be converted into numpy array or series to work as shown below:

df['invoice_date']=pd.Series(map(pd.Timestamp, df.invoice_date))

Instead you can use map as shown below:

df['invoice_date']=df['invoice_date'].map(pd.Timestamp)
1 Like

Thanks @ipraveenchowdary for the solution, it also worked well with code:

df[‘invoice_date’] = list(map(pd.Timestamp, df.invoice_date))

1 Like

Hi,

Attached is the data of an e-commerce transactional data. It contains the date format as YY-DD-MM and YY/DD/MM.
Could any one help that how can i change the format into one i.e. YY/DD/MM, so that i can extract day, month. year separately. I have tried using replace function but it didn’t worked.

Please refer to the attachment this might provide the solution to your requirement.

Hi @ipraveenchowdary ,

In my data, the date format is of two types

  1. YY-DD-MM
  2. YY/DD/MM

Now when I’m passing the pandas date_time function it is throwing the error at this format YY/DD/MM. So i taught of replacing the ‘/’ with ‘-’ but it is not working. Please refer to the attached below snapshot

If i do not pass the format in pandas date_time function and tries to get the month, it passes me the day instead of month and vice_versa. Please refer to the attached below snapshot

@ipraveenchowdary please see, i have tried your method too. In the month column, it should be 12 instead of 1

Hi @Ishvinder , can you help ?