<jupyter_start><jupyter_text>Q1<jupyter_code>num = int(input("Enter a number:"))
def PrintBinary(number):
    binary=""
    if (number!=0):
        while (number>=1):
            if (number %2==0):
                binary=binary+"0"
                number=number/2
            else:
                binary=binary+"1"
                number=(number-1)/2
    else:
        binary="0"
    print("".join(reversed(binary)))

def PrintBace8 (num):
    if(num > 7):
        PrintBace8(num // 8)
    print(num % 8,end="")
    
def PrintHex (num):
    if(num > 15):
        PrintEx(num // 16)
    if(num % 16 == 15):
        print("f",end="")
    elif(num % 16==14):
        print("e",end="")
    elif(num % 16==13):
        print("d",end="")
    elif(num % 16==12):
        print("c",end="")
    elif(num % 16==11):
        print("b",end="")
    elif(num % 16==10):
        print("a",end="")
    else :
        print(num % 16,end="")

PrintBinary(num)
PrintBace8(num)
print("")
PrintHex(num)<jupyter_output>Enter a number:45
101101
55
2d<jupyter_text>Q2<jupyter_code>import pandas as pd
import numpy as np
df_mov = pd.read_csv("C:\\Users\\סיטרון\\Downloads\\דאטה סט לעבודת יחיד פרוייקט גמר.txt")
df_cast = pd.read_csv("C:\\Users\סיטרון\\Downloads\\cast.csv")
df_cast.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 3333695 entries, 0 to 3333694
Data columns (total 6 columns):
 #   Column     Dtype  
---  ------     -----  
 0   title      object 
 1   year       int64  
 2   name       object 
 3   type       object 
 4   character  object 
 5   n          float64
dtypes: float64(1), int64(1), object(4)
memory usage: 152.6+ MB<jupyter_text>1.<jupyter_code>len(df[df['title'] == "Hamlet"])<jupyter_output><empty_output><jupyter_text>2.<jupyter_code>df[df.title == 'Treasure Island'].sort_values("year")<jupyter_output><empty_output><jupyter_text>3.<jupyter_code>len(df_cast[(df_cast.title == "Hamlet") & (df_cast.year == 1921)])<jupyter_output><empty_output><jupyter_text>4.<jupyter_code>t = df_mov[df_mov.title == "Hamlet"] # creating data frame with the title "Hamlet"
t.groupby(t.year // 10 * 10).size().plot(kind='bar') #shows the number of "Hamlet" films made in each decade<jupyter_output><empty_output><jupyter_text>5.<jupyter_code>df = df_cast # saving the data in a variable so I don't change it
df = df[df.year // 10 == 195] # each year of the 1950s  
df = df[df.n == 1] # leading roles 
df.groupby(['year', 'type']).size()<jupyter_output><empty_output><jupyter_text>6.<jupyter_code>cast = df_cast[df_cast['year'] >= 1990] # creating data frame since the 1990's
cast = cast[cast.n == 1] # chosing the rows with leading roles
cast.groupby('name').size().nlargest(10) # the top 10 actors/actresses<jupyter_output><empty_output><jupyter_text>7.<jupyter_code>df = df_cast[df_cast.name=='<NAME>'].groupby(['title','year']).size().reset_index() #creating data frame with the rows that have <NAME> 
                                                                                      # and adding the 'title' and 'year' colomn 
df = df[df[0]>1].sort_values('year') #chosing the rows that have more then 1 appearance
df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16424968474148802, 'fraction_numerical': 0.04319041614123581, 'mean_word_length': 3.142297650130548, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '326803', 'license': 'MIT', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1162, 'n_words': 233, 'path': 'yeela_ans.ipynb', 'repo_name': 'yeelacitron/data-since-project', 'size': '3176'}