Python Forum
creating date/time stamp from dataframe values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
creating date/time stamp from dataframe values
#1
I have a data frame that includes the following values:
Quote:Date
07/12/17

Start Time
05:00 PM
Each of these is currently stored as strings.

I need to format/concatenate this information to be in the following format:
Quote:'2017-07-12 17:00'
I'm new to python and most of the solutions I've found don't apply to pandas data frames.
Reply
#2
I think the df side is a distraction. The data you want is available as simple strings in a known format, namely:

  1. date string in the format dd/mm/yy e.g. int('07/12/17'[:2]) will give you 7.
  2. time string in the format hh:mm xx e.g. int('05:23 PM'[3:5]) will give you 23.

making it easy, without using any additional functions, to do some simple calculations and generate the strings you want.
I am trying to help you, really, even if it doesn't always seem that way
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  date and time jordex02 2 2,068 Dec-05-2019, 03:39 PM
Last Post: ichabod801
  Need help getting unique values across two columns of a dataframe a_real_phoenix 1 1,812 Jun-30-2019, 01:46 AM
Last Post: scidam
  Need to convert a date and price from a list into appropriate date format & currency SilverLeaf90 1 1,959 Mar-23-2019, 09:41 PM
Last Post: Yoriz
  Creating a variable that displays time groovydingo 3 2,889 Apr-17-2018, 04:46 AM
Last Post: tannishpage

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020