Programming > QUESTIONS & ANSWERS > University of California, Berkeley DATA MISC Homework 2: Arrays and Tables¶ (All)

University of California, Berkeley DATA MISC Homework 2: Arrays and Tables¶

Document Content and Description Below

University of California, Berkeley DATA MISC Homework 2: Arrays and Tables¶ Recommended Reading: • Data Types • Sequences • Tables. 1. Creating Arrays¶ Question 1. Make an arra... y called weird_numbers containing the following numbers (in the given order): 1. -2 2. the sine of 1.2 3. 3 4. 5 to the power of the cosine of 1.2 Hint: sin and cos are functions in the math module. In [2]: # Our solution involved one extra line of code before creating # weird_numbers. import math as m weird_numbers = make_array(-2, m.sin(1.2), 3, 5**(m.cos(1.2))) weird_numbers Question 2. Make an array called book_title_words containing the following three strings: "Eats", "Shoots", and "and Leaves". Strings have a method called join. join takes one argument, an array of strings. It returns a single string. Specifically, the value of a_string.join(an_array) is a single string that's the concatenation ("putting together") of all the strings in an_array, except a_string is inserted in between each string. Question 3. Use the array book_title_words and the method join to make two strings: 1. "Eats, Shoots, and Leaves" (call this one with_commas) 2. "Eats Shoots and Leaves" (call this one without_commas) Hint: If you're not sure what join does, first try just calling, for example, 2. Indexing Arrays¶ These exercises give you practice accessing individual elements of arrays. In Python (and in many programming languages), elements are accessed by index, so the first element is the element at index 0. Question 1. The cell below creates an array of some numbers. Set third_element to the third element of some_numbers Question 2. The next cell creates a table that displays some information about the elements of some_numbers and their order. Run the cell to see the partially-completed table, then fill in the missing information in the cell (the strings that are currently "???") to complete the table. Question 3. You'll sometimes want to find the last element of an array. Suppose an array has 142 elements. What is the index of its last element? Question 4. The cell below loads an array called president_birth_years. The last element in that array is the most recent birth year of any deceased president. Assign that year to most_recent_birth_year [Show More]

Last updated: 1 year ago

Preview 1 out of 20 pages

Reviews( 0 )

Recommended For You

 Programming> QUESTIONS & ANSWERS > University of California, Berkeley DATA MISC Homework 6: Probability, Simulation, Estimation, and Assessing Models (All)

preview
University of California, Berkeley DATA MISC Homework 6: Probability, Simulation, Estimation, and Assessing Models

Homework 6: Probability, Simulation, Estimation, and Assessing Models Reading: Randomness (https://www.inferentialthinking.com/chapters/09/randomness.html) Sampling and Empirical Distributions (ht...

By QuizMaster , Uploaded: Oct 02, 2022

$9

 Programming> QUESTIONS & ANSWERS > University of California, Berkeley DATA MISC Homework 10: Linear Regression (All)

preview
University of California, Berkeley DATA MISC Homework 10: Linear Regression

University of California, Berkeley DATA MISC  Homework 10: Linear Regression Reading: Prediction (https://www.inferentialthinking.com/chapters/15/prediction.html) 1. Triple Jump Distances vs....

By QuizMaster , Uploaded: Oct 02, 2022

$9

 Computer Science> QUESTIONS & ANSWERS > University of California, Berkeley DATA MISC  Lab 09 (All)

preview
University of California, Berkeley DATA MISC  Lab 09

University of California, Berkeley DATA MISC  Lab 09 August 6, 2019 [64]: # Initialize OK from client.api.notebook import Notebook ok = Notebook('lab09.ok') ==================================...

By Kirsch , Uploaded: Nov 08, 2022

$9

 Database Management> QUESTIONS & ANSWERS > University of California, Berkeley DATA MISC rah031 (All)

preview
University of California, Berkeley DATA MISC rah031

Project 3 - Classification Welcome to the third project of Data 8! You will build a classifier that guesses whether a movie is romance or action, using only the numbers of times words appear in the...

By AGRADES , Uploaded: Nov 08, 2022

$10

 DATA ANALYSIS> QUESTIONS & ANSWERS > University of California, Berkeley DATA MISC ProfMask8468 (All)

preview
University of California, Berkeley DATA MISC ProfMask8468

hw09 July 14, 2020 [1]: # Initialize OK from client.api.notebook import Notebook ok = Notebook('hw09.ok') ===================================================================== Assignment: Resamp...

By AGRADES , Uploaded: Nov 08, 2022

$8

 Business> QUESTIONS & ANSWERS > CLM 031 EXAM (All)

preview
CLM 031 EXAM

CLM 031 = 100% Question 1: 5b Select the statement that is correct concerning performance work statement (PWS) requirements: - All answers are correct. - PWS should describe requirements necessary...

By Book Worm, Certified , Uploaded: Nov 03, 2022

$5

 *NURSING> QUESTIONS & ANSWERS > PHIL 347 Week 6 Checkpoint Quiz. Score 100/100 (All)

preview
PHIL 347 Week 6 Checkpoint Quiz. Score 100/100

Question: What are the three fundamental reasoning strategies listed in the text? Question: What is comparative reasoning? On what skill is it based? Question: We learned four tests for evaluating...

By Amanda Rosales , Uploaded: Mar 24, 2021

$7

 Business> QUESTIONS & ANSWERS > BUSINESS 1007 (All)

preview
BUSINESS 1007

BUSINESS 1007 07 Key 1. (p. 178) Managers utilize organizational resources such as employees, information, and equipment to accomplish goals. 2. (p. 178) The main job of managers today is to w...

By Kirsch , Uploaded: Oct 19, 2019

$6

 Anthropology> QUESTIONS & ANSWERS > KOR 352 FA19 101 week 8 Quiz. Already Graded A (All)

preview
KOR 352 FA19 101 week 8 Quiz. Already Graded A

KOR 352 FA19 101: Week 8 Quiz Question 1 (0.25 points) Which of the following is not true of Kim and Finch’s observations during their field research in South Korea from 1997 to 2000? Question 1 o...

By Kirsch , Uploaded: Oct 17, 2019

$9

 E-Commerce> QUESTIONS & ANSWERS > ESOC 316 Digital Commerce - University Of Arizona. Midterm Quiz. 20 Q&A. 100% Score (All)

preview
ESOC 316 Digital Commerce - University Of Arizona. Midterm Quiz. 20 Q&A. 100% Score

ESOC 316 Digital Commerce - University Of Arizona. Midterm Quiz. 20 Q&A. 100% Score ESOC316 MIDTERM QUIZQuestion 6 (1 point) Saved Information has several properties that make information goods...

By Kirsch , Uploaded: Oct 15, 2019

$9.5

$9.00

Add to cart

Instant download

Can't find what you want? Try our AI powered Search

OR

GET ASSIGNMENT HELP
91
0

Document information


Connected school, study & course



About the document


Uploaded On

Oct 02, 2022

Number of pages

20

Written in

Seller


seller-icon
QuizMaster

Member since 4 years

1085 Documents Sold


Additional information

This document has been written for:

Uploaded

Oct 02, 2022

Downloads

 0

Views

 91

Document Keyword Tags

THE BEST STUDY GUIDES

Avoid resits and achieve higher grades with the best study guides, textbook notes, and class notes written by your fellow students

custom preview

Avoid examination resits

Your fellow students know the appropriate material to use to deliver high quality content. With this great service and assistance from fellow students, you can become well prepared and avoid having to resits exams.

custom preview

Get the best grades

Your fellow student knows the best materials to research on and use. This guarantee you the best grades in your examination. Your fellow students use high quality materials, textbooks and notes to ensure high quality

custom preview

Earn from your notes

Get paid by selling your notes and study materials to other students. Earn alot of cash and help other students in study by providing them with appropriate and high quality study materials.

WHAT STUDENTS SAY ABOUT US


What is Browsegrades

In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Browsegrades · High quality services·