Answer (A) and (B). Each prompt should be 2-4 sentences. M…
Answer (A) and (B). Each prompt should be 2-4 sentences. Make sure to identify and explain. This should take about 8 minutes to answer. A. Describe ONE specific example of a policy or action in England, France, Austria-Hungary or Russia that supported mass politics and unified the nation. B. Describe ONE specific example of a policy or action in England, France, Austria-Hungary or Russia that ignored mass politics and divided the nation.
Read DetailsQuestion 2: Assume that there exists a file named “aFile.txt…
Question 2: Assume that there exists a file named “aFile.txt” in the local disk. Write a program that prompts the user for a positive integer n as an input. The program should write the first n characters of each line in “aFile.txt” to a new file, named “newFile.txt”. The program should write the entire line, if n is greater than that line’s length. Below is a sample input and output for n = 10. Input – aFile.txt: First line of the file Second line of the file Third Output – newFile.txt: First line Second lin Third
Read DetailsA Jupyter template for the exam has been provided to you abo…
A Jupyter template for the exam has been provided to you above. Complete the template and use this text box area to submit the Secret Gist ID of your code (saved in your GitHub account). Use the next question (file upload question) to attach the .ipynb file.
Read DetailsConsider the DataFrame given in the previous question (named…
Consider the DataFrame given in the previous question (named df that already resides in memory). What is the output after running the following code? Assume that pandas package has already been imported. df.set_index(‘Team’,inplace=True) val = df.loc[(df[‘Conference’]==’East’) & (df[‘Wins’]>27),:].index print(list(val)) df.reset_index(inplace=True)
Read DetailsConsider the following DataFrame named df that resides in me…
Consider the following DataFrame named df that resides in memory: Conference Team Wins 0 East Atlanta Hawks 24 2 East Brooklyn Nets 28 4 East Chicago Bulls 27 What is the output after running the following statement? Assume that pandas package has already been imported. print(df.loc[2,’Wins’],df.iloc[2,2])
Read DetailsAssume that ‘example.txt’ does not exist in the local disk….
Assume that ‘example.txt’ does not exist in the local disk. Consider the following code: a_list = [1,2,3] file_obj = open(‘example.txt’, ‘w’) for num in a_list: print(num, end = ‘ ‘) print(num, file=file_obj, end=’ ‘)file_obj.close() What is the screen output after running this code?
Read DetailsConsider the following two Numpy arrays: 3×3 shape: arr1 = n…
Consider the following two Numpy arrays: 3×3 shape: arr1 = np.array([[7,31,1], [4,12,2], [19,8,16]] ) 1×3 shape: arr2 = np.array([[10,15,20]]) Which of the following Numpy functions can be used to stack arr2 to the bottom of arr1 so that the resulting array has the shape of 4×3?
Read Details