• Oct 7, 2022 •KETRICK
0 likes • 5 views
x[cat_var].isnull().sum().sort_values(ascending=False)
• Jun 1, 2023 •CodeCatch
0 likes • 3 views
filename = "data.txt" data = "Hello, World!" with open(filename, "a") as file: file.write(data)
• Jul 24, 2024 •AustinLeath
from statistics import median, mean, mode def print_stats(array): print(array) print("median =", median(array)) print("mean =", mean(array)) print("mode =", mode(array)) print() print_stats([1, 2, 3, 3, 4]) print_stats([1, 2, 3, 3])
• Aug 1, 2025 •AustinLeath
0 likes • 1 view
from typing import Optional from datetime import datetime def convert_timestamp_string_to_epoch(timestamp: str) -> Optional[int]: epoch_time = None time_obj = datetime.strptime(timestamp, "%Y-%m-%d %H:%M:%S.%f") epoch_time = int((time_obj - datetime(1970, 1, 1)).total_seconds() * 1000) return epoch_time print(int(convert_timestamp_string_to_epoch("2025-08-01 13:11:47.171"))) #above outputs 1754053907171.0 #how to I remove the .0 ?
• Nov 19, 2022 •CodeCatch
0 likes • 4 views
list_1 = [1,2,3,4,5,6,7,8,9] cubed = map(lambda x: pow(x,3), list_1) print(list(cubed)) #Results #[1, 8, 27, 64, 125, 216, 343, 512, 729]
0 likes • 2 views
from functools import partial def curry(fn, *args): return partial(fn, *args) add = lambda x, y: x + y add10 = curry(add, 10) add10(20) # 30