• Nov 19, 2022 •CodeCatch
0 likes • 8 views
from collections import Counter def find_parity_outliers(nums): return [ x for x in nums if x % 2 != Counter([n % 2 for n in nums]).most_common()[0][0] ] find_parity_outliers([1, 2, 3, 4, 6]) # [1, 3]
• Oct 7, 2022 •KETRICK
0 likes • 6 views
x[cat_var].isnull().sum().sort_values(ascending=False)
• May 5, 2026 •CodeCatch
0 likes • 12 views
• Jun 1, 2023 •CodeCatch
from colorama import init, Fore # Initialize colorama init() print(Fore.RED + "This text is in red color.") print(Fore.GREEN + "This text is in green color.") print(Fore.BLUE + "This text is in blue color.") # Reset colorama print(Fore.RESET + "This text is back to the default color.")
• Apr 21, 2023 •sebastianagauyao2002-61a8
0 likes • 7 views
print("hellur")
• May 31, 2023 •CodeCatch
0 likes • 3 views
import calendar # Prompt user for year and month year = int(input("Enter the year: ")) month = int(input("Enter the month: ")) # Create a calendar object cal = calendar.monthcalendar(year, month) # Display the calendar print(calendar.month_name[month], year) print("Mon Tue Wed Thu Fri Sat Sun") for week in cal: for day in week: if day == 0: print(" ", end="") else: print(str(day).rjust(2), " ", end="") print()