I am trying to convert a date & time string using Pandas ‘to_datetime’, but the string values is non-zero padded: I have the following but get a mismatch error Is there a way to add the zero padding or have ‘to_datetime’ accept the above formatting? Answer The trouble isn’t in the padding, it’s actually in your formatting call. Note the
Tag: string-to-datetime
Set the format for pd.to_datetime
Hi already referred to this post but I could not get through my issue. I have a column in my CSV which is string and the sample values are below (note that the month and year positioning are sometimes reversed). What format do I need to set in my to_datetime? I tried all the below approaches I get the error