time

Clock does not run

Clock does not run Question: I would like to programm a simple clock with python and tkinter indicating local and utc time in the same window. As you can see on the screenshoot, first clock local time is not running, but the second clock below utc time is running well. At the moment I can …

Total answers: 1

Merging columns Dataframe

Merging columns Dataframe Question: I have the following Dataframe: df1 startTimeIso endTimeIso id 2023-03-07T03:28:56.969000 2023-03-07T03:29:25.396000 5 2023-03-07T03:57:08.734000 2023-03-07T03:59:08.734000 7 2023-03-07T04:18:08.734000 2023-03-07T04:20:10.271000 16 2023-03-07T07:58:08.734000 2023-03-07T07:58:10.271000 21 and the second one: df2 startTimeIso endTimeIso value 2023-03-07T03:28:57.169000 2023-03-07T03:29:25.996000 true 2023-03-07T03:57:08.734000 2023-03-07T03:58:08.734000 true 2023-03-07T05:38:08.734000 2023-03-07T05:40:10.271000 true 2023-03-07T07:58:08.934000 2023-03-07T07:58:10.371000 true I want to check, if a row from df2 merge …

Total answers: 1

How do i write a string letter by letter using concatenation in python

How do i write a string letter by letter using concatenation in python Question: I currently have a way to write a string letter by letter but when i try and include more arguments it gives me the error that it was expecting 1 and not 3 I used this to define def delay_print(s): for …

Total answers: 2

Pandas does not respect conversion to time type

Pandas does not respect conversion to time type Question: I have this dataframe: site date time 1 AA 2018-01-01 0100 2 AA 2018-01-01 0200 3 AA 2018-01-01 0300 4 AA 2018-01-01 0400 5 AA 2018-01-01 0500 6 AA 2018-01-01 0600 7 AA 2018-01-01 0700 8 AA 2018-01-01 0800 9 AA 2018-01-01 0900 df.dtypes >>> site …

Total answers: 1

Timer that breaks when any input is given in Python

Timer that breaks when any input is given in Python Question: I am trying to find a way to create a timer in python that keeps counting while the user doesn’t input anything. The goal is to then create a function that automatically backs up the data from the session to a separate JSON file …

Total answers: 2

Bash check if file was modified within date range

Bash check if file was modified within date range Question: I have a script that checks to see if a cert, (.cer file), is within 14 days of expiring, and if it is, it will archive the old cert request, generate a new one, and send it to the middleware team. The thought occurs though, …

Total answers: 1

time complexity when working with python string

time complexity when working with python string Question: I’m analysing the complexity of string concatination for different methods and what I notice. %%time sent = "" word = "hello " num = 100000 for _ in range(num): sent += word this method takes 20ms %%time sent_1 = "".join([word] * num) the second method takes 4 …

Total answers: 1

How can I calculate a date differential in Python across multiple rows and columns?

How can I calculate a date differential in Python across multiple rows and columns? Question: I’m trying to calculate the differential between the first Sent date/time in an ID and the last Received date/time in an ID, grouping them by Source and Destination. Sample (named test_subset) looks like this (but it is ‘000s of rows): …

Total answers: 1

How to fix this problem when generating a pseudorandom number in Python?

How to fix this problem when generating a pseudorandom number in Python? Question: import hashlib import time def random(): hashtime = str(int(time.time() * (10 ** 6))) encoded = hashlib.new("sha3_512", hashtime.encode()) decoded = int(encoded.hexdigest(), 16) dcsmall = decoded / (10 ** (len(str(decoded)))) return (dcsmall) I tried this code to simulate the function random.random() without the module …

Total answers: 2