1

Very, very new to python and have a question:

Can someone tell me how to create a new date column that is the date this data was collected. For example, if this is from a Jan 1.xlsx file, this column should be full of Jan 1.

I know how to create the column but how do I populate with Jan 1? Right now I only have to do this with one file but I am going to have to do this for all 31 files for January.

All help greatly appreciated...

  • 1
    Does this answer your question? [Add column with constant value to pandas dataframe](https://stackoverflow.com/questions/24039023/add-column-with-constant-value-to-pandas-dataframe) – jtweeder Dec 31 '19 at 21:32

1 Answers1

0

After you instatiate dataframe (read file into pandas object). Just do:

df["dt"]="Jan 1"

It will populate whole column with this 1 value, for all rows

Grzegorz Skibinski
  • 12,624
  • 2
  • 11
  • 34