• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 8 páginas
Examen

Data Analysis With Python Test With Correct Answers -2.

Document preview thumbnail
Vista previa 2 fuera de 8 páginas

DATA ANALYSIS WITH PYTHON TEST WITH CORRECT ANSWERS -2.

Vista previa del contenido

DATA ANALYSIS WITH PYTHON TEST WITH CORRECT
ANSWERS #2
Import numpy - correct answer import numpy as np

How to print out multiple stuff on one line - correct answer Use commas to separate the
printed statements

Print("Some string", a_variable)

How to print multiple stuff and then print out space beneath the printed statement -
correct answer Use '\n'

Print("One Dimensional Array", x1, '\n')

How to separate stuff from a printed statement into different paragraphs - correct
answer Use sep='\n'

Print("One Dimensional Array", x1, sep='\n')

Two dimensional array - correct answer my_array= np.array([[3,4,5,6],[4,5,6,-9]])

How to return the number of dimensions an array has - correct answer x1.ndim

Return the number of elements a in each dimension of an array - correct answer
x1.shape

Return the total number of elements across all dimensions of an array - correct answer
x1.size

How to tell the data types of elements in an array - correct answer float_array.dtype

Return every third element of an array - correct answer my_array[::3]

Return every other element, starting with the first element - correct answer
my_array[1::2]

How to reverse an array - correct answer numeric_array[::-1]

How to add value to dictionary - correct answer No brackets on other side

University_info['country'] = 'United States'
University_info

Function rule - correct answer Always return, don't print

, How to sort with numpy - correct answer np.sort()

For multidimensional arrays, specify axis
Np.sort(my_array, axis=0)

0 sorts columns, and 1 sorts rows

Nd_player_weights.sort() would sort the original values

How to split up array according to your specs - correct answer np.split(my_array,
[3,5,8])

Will split up values with indexes 0-2, then 3-4, then 5-7, then 8 beyond

How to split an array into equal parts - correct answer np.array_split(my_array, 6)
NO BRACKETS
Six arrays with equal parts. It returns a list with the specified number of arrays inside of
it

Np.hsplit() - correct answer split_1, split_2 = np.hsplit(employee_salaries_grid,
indices_or_sections=[3])
Print("First Split", split_1, sep='\n')
Print("Second Split", split_2, sep='\n')

OUT:
First Split
[[ 101442. 94122. 101592.]
[ 87006. 102228. 84054.]
[ 90024. 82614. 48078.]
[ 76266. 68616. 62820.]]
Second Split
[[ 110064. 50436. 103350. 93354. 84054.]
[ 91272. 111492. 95484. 114846. 63480.]
[ 72510. 48078. 110064. 110064. 42108.]
[ 128970. 48078. 89148. 101712. 70092.]]

Np.vsplit() - correct answer split_1, split_2, split_3 = np.vsplit(employee_salaries_grid,
[1, 3])

Print(split_1, split_2, split_3, sep='\n\n')

OUT:
[[ 101442. 94122. 101592. 110064. 50436. 103350. 93354. 84054.]]

[[ 87006. 102228. 84054. 91272. 111492. 95484. 114846. 63480.]
[ 90024. 82614. 48078. 72510. 48078. 110064. 110064. 42108.]]

Información del documento

Subido en
9 de febrero de 2026
Número de páginas
8
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$15.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Vendido
101
Seguidores
44
Artículos
5717
Última venta
2 semanas hace




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes