Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

QMB3302 EXAM 1 QUESTIONS WITH COMPLETE SOLUTIONS

Beoordeling
-
Verkocht
-
Pagina's
19
Cijfer
A+
Geüpload op
21-05-2025
Geschreven in
2024/2025

QMB3302 EXAM 1 QUESTIONS WITH COMPLETE SOLUTIONS

Instelling
QMB3302
Vak
QMB3302

Voorbeeld van de inhoud

QMB3302 EXAM 1 QUESTIONS WITH COMPLETE
SOLUTIONS




Imagine we have a dataframe, df. What would be the purpose for running code like the
one below? (why would we run it?)



df.loc[1] -- Answer ✔✔ To look for, retrieve a value from df



Imagine we have a pandas dataframe we have named 'df'.



The dataframe consists of 2 columns.



"col1" is 30 values long, and is a random mix of the letters 'a', 'b', and 'c'.

"num1" is also 30 values long, and is a random set of numerical data (all integers).



Which of the following would give you the mean of the numerical (num1) column,
grouped by the values from column "col1"? -- Answer ✔✔ df.groupby('col1'). mean()



What is the shape of the following numPy array?

,np.random.seed(1955)x = np.random.randn(2, 2, 2, 2)

print(x.shape)

x



#Hint: I have not loaded the necessary package here...but you should(load pandas,
import numpy) -- Answer ✔✔ (2, 2, 2, 2)



What is the output of the following code?

import numpy as np

list1 = [5, 5, 5]

list2 = [10, 10, 10]

np_list1 = np.array(list1)

np_list2 = np.array(list2)

np_list1/np_list2 -- Answer ✔✔ array([0.5, 0.5 0.5])



numPy allows us to do more complicated math on lists and other data structures, and is
used in most of the more advanced modules we will use (such as pandas) -- Answer ✔✔
true



pandas can be imported as import pandas as pd -- Answer ✔✔ true



Usually a programmer will use conventional names when importing packages. But it is
not strictly necessary. numpy for example can be imported as: import numpy as
humpty_dumpty -- Answer ✔✔ true

, pandas allows us to use multiple different data types (like objects and numbers) in a
single table. -- Answer ✔✔ true



for pandas to work, data must be formatted as lists before it is imported -- Answer ✔✔
false



When importing data from a local drive, the relative path was defined as the path FROM
where your code in your current working directory is, TO where your data is. --
Answer ✔✔ true



Look at the below code carefully. It is not at all uncommon to see errors of omission in
code chunks like this. How can you fix the below so that it produces the output
'array([50, 50, 100])'



import numpy as np

list1 = [5,5,5]

list2 = [10,10,20]

np_list1 = np.array(list1)

np_list2 = np.array(list2)

np_list1 is_and np_list2 -- Answer ✔✔ change "np_list1 is_and np_list2" to
"np_list1*np_list2"



pandas has functionality to work with complicated dates. -- Answer ✔✔ true

Geschreven voor

Instelling
QMB3302
Vak
QMB3302

Documentinformatie

Geüpload op
21 mei 2025
Aantal pagina's
19
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$12.79
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
Betatutors Chamberlain College Of Nursing
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
20
Lid sinds
1 jaar
Aantal volgers
0
Documenten
2060
Laatst verkocht
1 dag geleden
REALEXAMS

4.0

3 beoordelingen

5
1
4
1
3
1
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen