Practice2_Spring_2024
.docx
keyboard_arrow_up
School
Columbia University *
*We aren’t endorsed by this school
Course
5210
Subject
Computer Science
Date
Apr 3, 2024
Type
docx
Pages
4
Uploaded by DeaconHare3679
Python for Data Analysis – Practice 2
1.
Consider the list below:
school_material_list = ['books', 'notebooks', 'pencils', 'pens', 'erasers']
What output is generated by the statement below?
print(school_material_list[5]) a.
[‘erasers’]
b.
erasers
c.
IndexError
d.
None of the above
2.
Consider the list below:
MyExpenses = [[10, 25, 60], [34, 95, 17], [18, 26, 48]]
What is the outcome of the statement below?
print(MyExpenses[2][2])
a. [34,95,17]
b. (34,95,17)
c. 95
d.
None of the above
3.
What will the code below print?
my_list1 = [76, 77, 78, 79]
my_list2 = [40, 41]
my_list3 = my_list1 + my_list2 my_list3.append(99)
print(my_list3)
a.
(76, 77, 78, 79, 99)
b.
[76, 77, 78, 79, 40, 41]
c.
[76, 77, 78, 79, 40, 41, 99]
d.
[76, 77, 78, 79, 99]
e.
none of the above
4.
Consider the code below. Which is the output of the print statement?
MyData = ([101.32, 97.34, 96.51], [1231, 2500, 3477], [.8,.95, .65])
print(MyData[2])
a.
(1231, 2500, 3477)
b.
[.8, .95, .65]
c.
.95
d.
None of the above
5. Given the tuple below, what is the output of the code below?
T1 = ([2, 3, 5], [6, 10, 11], [9, 8, 7])
T1[1][1] = 13
print(T1[1])
a.
13
b.
Type Error: tuple object does not support item assignment
c.
[6, 13, 11]
d.
none of the above
6.
Consider the following list:
lst=[‘a’,’b’,’c’,’d’,’e’,’f’]
What will lst[1:3]
give you?
a. [‘a’,’b’,’c’]
b. [‘a’,’b’]
c. [‘b’,’c’]
d. [‘b’,’c’,’d’]
7. Consider the following list: a = [77,78,79,80,81,82]
What will a[1:6:2]
give you?
a.
[77, 78, 79, 80, 81, 82]
b.
[78, 80, 82]
c.
[78, 79, 80, 81, 82]
d.
none of the above
8.
What will be the output of the code below?
str1 = ‘Applied Analytics’
print(str1[-9::2])
a.
Aayis
b.
Analytics
c.
Apid
d.
none of the above
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Python
arrow_forward
Python Programming Problem: Simple Soccer Point TableThe programmer will design a simple point table lookup and update application. The table contains some basic information: team_name, match_played, win, draw, loss, point and rank.
Design Solution:1. English Premier League is a prestigious soccer league. Here is the result of its one session.
Man. City|38|32|2|4|98|1Liverpool|38|30|7|1|97|2Chelsea|38|21|9|8|72|3Tottenham|38|23|2|13|71|4Arsenal|38|21|7|10|70|5
2. Hypothetically, you have been assigned to design a simple lookup software for prestigious ‘English Premier League’ from a given point table. The point table contains team_name, match_played,win, draw, loss, points and rank.
3. The input file, ‘previous_result.txt’ has been provided to you above the top 5 teams in 2018-19 session. Your software needs to be able to search and update the point table based on user input. For example: The first time Chelsea played 38, the second time it changed (based on user input) to 40 and so…
arrow_forward
Direction: Answers must be explained properly and thoroughly. You have to insert a screenshot of the results. Include the observations of your code.
Python download: https://www.python.org/downloads/ Any Python Version 3.8 and later is recommended
arrow_forward
Computer Science: What is the difference between beginning a data modeling project with a packaged data model on a blank piece of paper.
arrow_forward
2. [summary_report.py] Timesheet data is easy to represent in a file, where it can be used to generate a report and help the worker get paid! Given an example
set of data where each row represents a day of the week and each entry on the row represents a block of time worked, like this:
1.5h 3.25h
3.8h 6.Oh 1.eh
5. 5h 2.25h 0.75h
2.25h 3.0h 3.0h
5.75h 2.25h
A report could be produced by a program like this:
0.00h |
5.25h | 1.5en 3.25h 0.5eh
10.00h
0.00h
3.00h 6.00h 1.00h
8.50h
5.50h 2.25h 8.75h
8.25h
8.00h
0.00h | e.00h
2.25h 3.00h 3.00h
5.75h 2.25h
Weekly Total: 40.00h
Notice how in the output file all the numbers are nicely formatted as right-aligned. Hint: you will probably need to use splitting, string slicing, converting data
types, and string formatting.
create a program that uses a data file that you have created, parses the data in that file to create a calculation per row and a running
total, then writes the report to an output file. Your program should prompt a user to input a…
arrow_forward
Direction: Answers must be explained properly and thoroughly. You have to insert a screenshot of the results. Include the observations of your code.
Python download: https://www.python.org/downloads/ Any Python Version 3.8 and later is recommended
arrow_forward
Programming Language: C++
6. Separate compilation was useful in older programming languages, but having multiple files adds an unnecessary layer of complexity and is discouraged in modern programming languages. = true or false?
arrow_forward
Programming language to use: Java / Python
Assignment:
You have a dictionary of symptoms. Some are top level symptoms (Abdominal pain, Chest Pain) and others are children connected to these parents by relationships.
Example: 'Abdominal pain, right upper quadrant' is a child of 'Abdominal pain' via relation 'location', 'Abdominal pain, mild' is a child of 'Abdominal Pain' via relation 'severity'.
Dictionary:
Abdominal pain
Abdominal pain, right upper quadrant
Abdominal pain, right lower quadrant
Abdominal pain, left upper quadrant
Abdominal pain, right upper quadrant
Abdominal pain, mild
Abdominal pain, moderate
Abdominal pain, severe
Chest pain
Chest pain, left side
Chest pain, right side
Chest pain, mild
Chest pain, moderate
Chest pain, severe
Tasks:
Create the symptoms tree and print it.
Output:
Root
--symptom--Abdominal pain
--location--Abdominal pain, right upper quadrant…
arrow_forward
7-2 Discussion: Interpreting Multiple Regression Models
Previous Next
In this discussion, you will apply the statistical concepts and techniques covered in this week's reading about multiple regression. You will not be completing work in Jupyter Notebook this week. Instead, you will be interpreting output from your Python scripts for the Module Six discussion. If you did not complete the Module Six discussion, please complete that before working on this assignment.
Last week's discussion involved development of a multiple regression model that used miles per gallon as a response variable. Weight and horsepower were predictor variables. You performed an overall F-test to evaluate the significance of your model. This week, you will evaluate the significance of individual predictors. You will use output of Python script from Module Six to perform individual t-tests for each predictor variable. Specifically, you will look at Step 5 of the Python script to answer…
arrow_forward
Attention>>>>>>>>> project should written in C languages In the project, a student affairs information system simulation is requested to be made using structures (“struct”), linked lists (“linked list”) and files (“file”). According to this;
a) Create a structure called a course. The members of this structure are code, name, instructor, term (can take Spring or Fall values), year, and a course pointer. Functions with prototype void insertCourse(CourseNodePtr* cr, CourseNodePtr* inscr, char* code), char* deleteCourse(CourseNodePtr* cr, CourseNodePtr* inscr, char* code) that will operate on course data structure elements, since the courses taken by the students are to be kept with a linked list. write. While writing the insertCourse() function, prevent the same student from taking the same course more than once.
b) Create a structure called student. Let the members of this structure be id, name, surname, department, class (can take B.Sc., M.Sc., Ph.D.),…
arrow_forward
. In Python, lists area. mutable data structuresb. static data structuresc. dynamic data structuresd. Both a. and c
arrow_forward
Using C# (Sharp) with Visual studio:
Make a class of Book with 5 properties - ISBN, author, title, publisher, copyright date
In the main method, create 5 instances of the Book class with different data for each
Create a LIST and add each of the 5 objects to the LIST
Use a foreach loop to display the ISBN, author, title, publisher, and copyright date in the LIST
Create a DICTIONARY and add each of the 5 objects (key should be ISBN)
Display author, title, publisher, copyright date for each book
Create a SEARCH feature: ask the user to type in an ISBN. If the entry matches an item in your dictionary, display the author, title, publisher, and copyright date. If there are no matches, display "ISBN not found". Hint: use ContainsKey
Create a REMOVE feature: ask the user to type in an ISBN to remove a book from the list. If the entry matches an item in your dictionary, remove the item and re-display your list. If there are no matches, display "ISBN not found".
arrow_forward
Alert dont submit AI generated answer.
arrow_forward
Point of sales systemcreate a POS in java that will have the basic operation of a point of sales System.your system should provide the following:1. a login frame to allow the employee to login2. cash register sales3. items scanning when a client bring the product4. real time stock level5. stock infosl (product codes ,and informartion such as price and quantity)6. sales reportall the product must be stored in a SQL database using necessary security.Note:1. Use GUI to make the application2. Do not use any builder to drag and drop component
arrow_forward
c++
arrow_forward
Please help me with this question with python language. I have also attached ouput value pic below just in case.
arrow_forward
Programming Language BSL
Purpose To design a small program using structured data.
Expectations
You should submit a single .rkt file containing your responses to all exercises via the Handin Server. We accept NO email submissions. Failure to submit a .rkt file will result in a 0.
You are only allowed to use the language specified at the top of this page: failure to do so will result in a 0. You should only use the concepts that we have covered in class so far.
Your code MUST conform to the guidelines outlined in the style guide on the course website. The style guide will be updated as the semester progresses so please remember to read it before submitting each assignment.
You must follow all the steps of the design recipe when completing this assignment.
Graded Exercises
Exercise 1 Design a data definition for a mathematical expression. Your data definition should be able to handle the addition, subtraction, and multiplication of any two integers. You do not need to…
arrow_forward
Arrays provide what advantages? An array may have as many dimensions as it can handle. What is the difference between a structure and a simple kind of parameter? It would be helpful to see an example of a complex data structure.
arrow_forward
Must show it in Python:
Please show step by step with comments.
Please show it in simplest form.
Input and Output must match with the Question
Please go through the Question very carefully.
arrow_forward
Using python code
arrow_forward
Computer Science
[ { "firstName": "Abdo ", "lastName": "Saleh", "email": "ab@iii.com", "password": "123455" }, { "firstName": "Ahmed ", "lastName": "Khaled", "email": "ak@iiicom", "password": "33242" } ]
I have these users when I create a new I want it add under theses users in json file using Kotlin
arrow_forward
4. Movie Store System
This is a system for selling and buying DVDs and videos of movies. There will be three types of users.
First the regular customers, they can access the database of DVDs and videos with different types of search.
Second there is a group of users that can post DVDs or/and videos to be sold. These users have access to
add movies to the database, so that regular customers can search for these movies. When the customer has
finished searching for a DVD and/or a video he/she can communicate a message to the seller in order
to buy the product from him. The third class of user is the administrator; this user will be in charge of
administrating the database and users. The administrator will be in charge of giving and revoking
selling privileges to regular customers so that they are able to add videos and DVDs in the database.
Use Visual Paradigm to answer the above question with following four UML diagrams:
UML Diagram to be used: USE CASE (For Documentation), Class Diagram…
arrow_forward
Java - Data Visualization (this is not graded)
arrow_forward
please use c#
i just want you to modify the code please
Download the solution and run it locally. Familiarize yourself with the code, then modify it as follows:
1. Replace the use of depth first search with the breadth first search algorithm.
2. Add at least 5 more employees
// The code below was mostly taken directly from:// https://www.csharpstar.com/csharp-depth-first-seach-using-list/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;
namespace depthFirstSearch{ class Program
{ public class Employee { public Employee(string name) { this.name = name; }
public string name { get; set; } public List<Employee> Employees { get { return EmployeesList; } }
public void isEmployeeOf(Employee e) {…
arrow_forward
Assignment 1 University Library SystemIn this assignment you are going to implement your own version of university library system,The system will have two different sides , the first one is to help the librarian to do his job and the other side for admin to manage every one permissions in the system , so You should provide the following features in your system: Admin viewo Add/remove Studentso Add/remove librariano Add/remove other admins Librarian viewo Add/Delete bookso Issue/Return bookso View bookso View Issued bookso Log in /log outo Search for the book(id/name) Simple backend for your system , You could use a file each row should represent item o Books File should be something like:Id , Book Name, Author Name, Available quantity, Issued Quantity 1,Oliver Twist, Charles Dickens,98,2In the previous the first row was the name of each column , you can do that orhandle it in your code , id =1 , Book Name =Oliver Twist ..Etc. Tables neededo Books Id Book Name Author Name…
arrow_forward
Input the name and marks in 4 subjects of 7 students. Print the rank list in ascending order where rank is calculated by averaging of 4 subject’s marks. Print the name of first ranker and print the percentage of each student in c programming language.
arrow_forward
Write, test, and debug (if necessary) PHP scripts for the specifications that follow write functions and the code to test them.
Parameter: A string containing words that are delimited on the left with spaces and on the right with spaces, commas, periods, or question marks. Return value: The three most common words in the string that have more than three letters
Parameter: An array of strings. Return value: A list of the three strings that occur most frequently in the parameter array
arrow_forward
What is a data abstraction?
1 p
a list / array
onEvent
global variable(s)
a function
arrow_forward
Query Board Python or Java(Preferred Python please) Thank you!
Programming challenge description:
There is a board (matrix). Every cell of the board contains one integer, which is 0 initially.The following operations can be applied to the Query Board:SetRow i x: change all values in the cells on row "i" to value "x".SetCol j x: change all values in the cells on column "j" to value "x".QueryRow i: output the sum of values on row "i".QueryCol j: output the sum of values on column "j".The board's dimensions are 256x256."i" and "j" are integers from 0 to 255."x" is an integer from 0 to 31.
Input:
Your program should read lines from standard input. Each line contains one of the above operations.
Output:
For each query, output the result of the query.
Test 1
Test InputDownload Test 1 Input
SetCol 32 20 SetRow 15 7 SetRow 16 31 QueryCol 32 SetCol 2 14 QueryRow 10
Expected OutputDownload Test 1 Input
5118 34
arrow_forward
Topic 3 DQ 1: What is a deque? Write a small program that demonstrates the deque data structure.
arrow_forward
Question no 01: Mr. Patrick is fond of reading books he is looking for a computerized way to keep record of hisbook collection, you have been given the responsibility to meet up his following requirements.(Use appropriate data structure to accomplish your task), develop following methods:1. Add(): adds a new book to the list ( A book contains name of the book, author name)NOTE: every new book will have access to its neighboring books (previous and next)2. Remove():in case any book is removed from the pile update your list 3. countBooks(): displays the total number of books 4. search(): returns true if the given book is present in the list else returns false 5. display(): shows the book collection
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Related Questions
- Pythonarrow_forwardPython Programming Problem: Simple Soccer Point TableThe programmer will design a simple point table lookup and update application. The table contains some basic information: team_name, match_played, win, draw, loss, point and rank. Design Solution:1. English Premier League is a prestigious soccer league. Here is the result of its one session. Man. City|38|32|2|4|98|1Liverpool|38|30|7|1|97|2Chelsea|38|21|9|8|72|3Tottenham|38|23|2|13|71|4Arsenal|38|21|7|10|70|5 2. Hypothetically, you have been assigned to design a simple lookup software for prestigious ‘English Premier League’ from a given point table. The point table contains team_name, match_played,win, draw, loss, points and rank. 3. The input file, ‘previous_result.txt’ has been provided to you above the top 5 teams in 2018-19 session. Your software needs to be able to search and update the point table based on user input. For example: The first time Chelsea played 38, the second time it changed (based on user input) to 40 and so…arrow_forwardDirection: Answers must be explained properly and thoroughly. You have to insert a screenshot of the results. Include the observations of your code. Python download: https://www.python.org/downloads/ Any Python Version 3.8 and later is recommendedarrow_forward
- Computer Science: What is the difference between beginning a data modeling project with a packaged data model on a blank piece of paper.arrow_forward2. [summary_report.py] Timesheet data is easy to represent in a file, where it can be used to generate a report and help the worker get paid! Given an example set of data where each row represents a day of the week and each entry on the row represents a block of time worked, like this: 1.5h 3.25h 3.8h 6.Oh 1.eh 5. 5h 2.25h 0.75h 2.25h 3.0h 3.0h 5.75h 2.25h A report could be produced by a program like this: 0.00h | 5.25h | 1.5en 3.25h 0.5eh 10.00h 0.00h 3.00h 6.00h 1.00h 8.50h 5.50h 2.25h 8.75h 8.25h 8.00h 0.00h | e.00h 2.25h 3.00h 3.00h 5.75h 2.25h Weekly Total: 40.00h Notice how in the output file all the numbers are nicely formatted as right-aligned. Hint: you will probably need to use splitting, string slicing, converting data types, and string formatting. create a program that uses a data file that you have created, parses the data in that file to create a calculation per row and a running total, then writes the report to an output file. Your program should prompt a user to input a…arrow_forwardDirection: Answers must be explained properly and thoroughly. You have to insert a screenshot of the results. Include the observations of your code. Python download: https://www.python.org/downloads/ Any Python Version 3.8 and later is recommendedarrow_forward
- Programming Language: C++ 6. Separate compilation was useful in older programming languages, but having multiple files adds an unnecessary layer of complexity and is discouraged in modern programming languages. = true or false?arrow_forwardProgramming language to use: Java / Python Assignment: You have a dictionary of symptoms. Some are top level symptoms (Abdominal pain, Chest Pain) and others are children connected to these parents by relationships. Example: 'Abdominal pain, right upper quadrant' is a child of 'Abdominal pain' via relation 'location', 'Abdominal pain, mild' is a child of 'Abdominal Pain' via relation 'severity'. Dictionary: Abdominal pain Abdominal pain, right upper quadrant Abdominal pain, right lower quadrant Abdominal pain, left upper quadrant Abdominal pain, right upper quadrant Abdominal pain, mild Abdominal pain, moderate Abdominal pain, severe Chest pain Chest pain, left side Chest pain, right side Chest pain, mild Chest pain, moderate Chest pain, severe Tasks: Create the symptoms tree and print it. Output: Root --symptom--Abdominal pain --location--Abdominal pain, right upper quadrant…arrow_forward7-2 Discussion: Interpreting Multiple Regression Models Previous Next In this discussion, you will apply the statistical concepts and techniques covered in this week's reading about multiple regression. You will not be completing work in Jupyter Notebook this week. Instead, you will be interpreting output from your Python scripts for the Module Six discussion. If you did not complete the Module Six discussion, please complete that before working on this assignment. Last week's discussion involved development of a multiple regression model that used miles per gallon as a response variable. Weight and horsepower were predictor variables. You performed an overall F-test to evaluate the significance of your model. This week, you will evaluate the significance of individual predictors. You will use output of Python script from Module Six to perform individual t-tests for each predictor variable. Specifically, you will look at Step 5 of the Python script to answer…arrow_forward
- Attention>>>>>>>>> project should written in C languages In the project, a student affairs information system simulation is requested to be made using structures (“struct”), linked lists (“linked list”) and files (“file”). According to this; a) Create a structure called a course. The members of this structure are code, name, instructor, term (can take Spring or Fall values), year, and a course pointer. Functions with prototype void insertCourse(CourseNodePtr* cr, CourseNodePtr* inscr, char* code), char* deleteCourse(CourseNodePtr* cr, CourseNodePtr* inscr, char* code) that will operate on course data structure elements, since the courses taken by the students are to be kept with a linked list. write. While writing the insertCourse() function, prevent the same student from taking the same course more than once. b) Create a structure called student. Let the members of this structure be id, name, surname, department, class (can take B.Sc., M.Sc., Ph.D.),…arrow_forward. In Python, lists area. mutable data structuresb. static data structuresc. dynamic data structuresd. Both a. and carrow_forwardUsing C# (Sharp) with Visual studio: Make a class of Book with 5 properties - ISBN, author, title, publisher, copyright date In the main method, create 5 instances of the Book class with different data for each Create a LIST and add each of the 5 objects to the LIST Use a foreach loop to display the ISBN, author, title, publisher, and copyright date in the LIST Create a DICTIONARY and add each of the 5 objects (key should be ISBN) Display author, title, publisher, copyright date for each book Create a SEARCH feature: ask the user to type in an ISBN. If the entry matches an item in your dictionary, display the author, title, publisher, and copyright date. If there are no matches, display "ISBN not found". Hint: use ContainsKey Create a REMOVE feature: ask the user to type in an ISBN to remove a book from the list. If the entry matches an item in your dictionary, remove the item and re-display your list. If there are no matches, display "ISBN not found".arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning