OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Formatting month to the single digit with pandas

  • Thread starter Thread starter Bogaso
  • Start date Start date
B

Bogaso

Guest
I have below code

Code:
import pandas as pd
pd.to_datetime(['8/23/1999']).strftime("%m/%d/%Y").astype('str')

This generates 08/23/1999

However I want to get 8/23/1999

Is there any specific formatting to be used for this case?
<p>I have below code</p>
<pre><code>import pandas as pd
pd.to_datetime(['8/23/1999']).strftime("%m/%d/%Y").astype('str')
</code></pre>
<p>This generates <code>08/23/1999</code></p>
<p>However I want to get <code>8/23/1999</code></p>
<p>Is there any specific formatting to be used for this case?</p>
 

Latest posts

J
Replies
0
Views
1
jbowerbir
J
Top