Title: How to create duplicate Dates in Python
Tags: python-3.x;pandas;dataframe;date
Question: I have a data frame named df and it has a column DATES, I want to fill it with 1million dates(doesn't need to be unique) in day.month.year format. Ex: 01.01.2020



Here is another answer: Replace ```dt.now()``` with whatever date you want:
```df[&quot;DATES&quot;] = np.repeat(dt.now().strftime(&quot;%m.%d.%Y&quot;),1000000)
```


Here is another answer: you can use ```date_range``` method in pandas.Also you can shuffle it and assign to column.
```period = 1000000
df[&quot;DATES&quot;] = pd.date_range(end='1.1.2020', periods=period )
```

Comment for this answer: @noah i think your suggestions are correct.I will change the answer.Thank you
Comment for this answer: This requires the df to be 1,000,000 rows already which I'm not sure is the case in the question (easy for them to change periods to 1,000,000 though). It also needs an `end='1.1.2018'` since dealing with such a large number of dates (or else goes beyond max date value).
Comment for this answer: `date_range` is definitely a "better" approach than my `np.repeat()` though!

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2020:00:11/24/20', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<python-3.x><pandas><dataframe><date>', 'Title': 'How to create duplicate Dates in Python', 'ViewCount': 55, 'id': 64979100, 'user_AboutMe': '<p>Programmer by Day and Pimp by Night.</p>\n', 'user_AccountId': 13512273.0, 'user_DisplayName': 'Eric', 'user_Reputation': 31.0, 'user_Views': 14.0, 'user_id': 9748146.0}}