Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Date to integer?
#1
HI everyone,

I am looking to convert a date to integer, how do I go about this? column below
Qtr-Year
Mar-90	
Jun-90
Sep-90
Dec-90
Mar-91
do I first need to change the date format to '031990' etc then change it to a str then interger?

I appreciate any help
Thanks
Quote
#2
Convert it into a datetime object:
See here: https://python-forum.io/Thread-help-with...-to-Python

Or convert into a time object:
See here: https://docs.python.org/3.7/library/time.html
Quote
#3
better if year is firs and then month, e.g. 9003, 9006, etc. this will allow to sort the integers in correct order
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Reading in MYSQL data as integer type Daveinthebigcity 2 77 May-13-2019, 11:30 AM
Last Post: Daveinthebigcity
  Replacing an integer by looking at a dictionary wendysling 3 156 May-02-2019, 03:38 PM
Last Post: wendysling
  How to change existing date to current date in a filename? shankar455 1 134 Apr-17-2019, 01:53 PM
Last Post: snippsat
  Writing integer to file jpezz 4 241 Apr-02-2019, 07:22 PM
Last Post: jpezz
  Help regarding date format Prince_Bhatia 2 119 Apr-01-2019, 05:46 AM
Last Post: Prince_Bhatia
  Sorting csv or txt file on date and time AshBax 4 179 Mar-27-2019, 02:02 PM
Last Post: AshBax
  How to create meshgrid with non-integer stepsize of list elements? dazzabaijan 1 134 Mar-11-2019, 02:00 AM
Last Post: ichabod801
  Printing Easter date occurrences samsonite 8 270 Mar-06-2019, 11:49 AM
Last Post: samsonite
  finding yesterday and tomorrrow without using date.time module apexman 10 381 Feb-25-2019, 05:33 AM
Last Post: samsonite
  Complex Integer saumyagoel 2 233 Feb-20-2019, 12:01 AM
Last Post: scidam

Forum Jump:


Users browsing this thread: 1 Guest(s)