• Oct 7, 2022 •KETRICK
0 likes • 4 views
x[cat_var].isnull().sum().sort_values(ascending=False)
• Nov 19, 2022 •CodeCatch
0 likes • 3 views
def clamp_number(num, a, b): return max(min(num, max(a, b)), min(a, b)) clamp_number(2, 3, 5) # 3 clamp_number(1, -1, -5) # -1
0 likes • 0 views
import pandas as pd x = pd.read_excel(FILE_NAME) print(x)
• May 31, 2023 •CodeCatch
0 likes • 2 views
# Prompt user for base and height base = float(input("Enter the base of the triangle: ")) height = float(input("Enter the height of the triangle: ")) # Calculate the area area = (base * height) / 2 # Display the result print("The area of the triangle is:", area)
def print_pyramid_pattern(n): # outer loop to handle number of rows # n in this case for i in range(0, n): # inner loop to handle number of columns # values changing acc. to outer loop for j in range(0, i+1): # printing stars print("* ",end="") # ending line after each row print("\r") print_pyramid_pattern(10)
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]