Strings in Python

Remove spaces at front of a word in python

’ hello world!’.lstrip() ‘hello world!’

see []

Splitting A String

If it is space split. ‘'’python string.split(‘ ‘) ‘’’ see []

String to date time

from datetime import datetime

datetime_object = datetime.strptime(‘Jun 1 2005 1:33PM’, ‘%b %d %Y %I:%M%p’)

see []

for a list of all the short cuts % see []

If it follows a certain format, this will be easier: from dateutil import parser datetime_obj = parser.parse(‘2018-02-06T13:12:18.1278015Z’)

See []

Get the day of week from date