• Oct 7, 2022 •KETRICK
0 likes • 1 view
import pandas as pd x = pd.read_excel(FILE_NAME) print(x)
0 likes • 5 views
x[cat_var].isnull().sum().sort_values(ascending=False)
• May 31, 2023 •CodeCatch
0 likes • 0 views
# Function to check Armstrong number def is_armstrong_number(number): # Convert number to string to iterate over its digits num_str = str(number) # Calculate the sum of the cubes of each digit digit_sum = sum(int(digit) ** len(num_str) for digit in num_str) # Compare the sum with the original number if digit_sum == number: return True else: return False # Prompt user for a number number = int(input("Enter a number: ")) # Check if the number is an Armstrong number if is_armstrong_number(number): print(number, "is an Armstrong number.") else: print(number, "is not an Armstrong number.")
• Oct 23, 2026 •zsq1364202622-89e7
0 likes • 2 views
def remove_repeated_blocks(content_list: list[str], line_count: int) -> list[str]: """删除相邻重复的代码块,保留第一次出现的内容。""" if line_count <= 0: return content_list result = [] seen = set() i = 0 while i < len(content_list): block = tuple(line.strip() for line in content_list[i:i + line_count]) if len(block) < line_count: result.extend(content_list[i:]) break if block in seen: i += line_count continue seen.add(block) result.extend(content_list[i:i + line_count]) i += line_count return result
• Mar 10, 2021 •Skrome
0 likes • 4 views
color2 = (60, 74, 172) color1 = (19, 28, 87) percent = 1.0 for i in range(101): resultRed = round(color1[0] + percent * (color2[0] - color1[0])) resultGreen = round(color1[1] + percent * (color2[1] - color1[1])) resultBlue = round(color1[2] + percent * (color2[2] - color1[2])) print((resultRed, resultGreen, resultBlue)) percent -= 0.01
• Nov 19, 2022 •CodeCatch
0 likes • 7 views
# function which return reverse of a string def isPalindrome(s): return s == s[::-1] # Driver code s = "malayalam" ans = isPalindrome(s) if ans: print("Yes") else: print("No")