Skip to main content
BSC Moodle
Log in
  • Moodle Home
  • MyBSC Links
    Academic Alerts (formerly Starfish) Apogee BSC Email BSC Intranet BSC Website Change Password Colleague Events Records IT Helpdesk IT Help for Online Course Students Library MobilePrint OrgSync TheSIS Time & Attendance Trakstar
  • Moodle FAQs
  1. Home
  2. Courses
  3. Miscellaneous
  4. 22WI_CACC2993
  5. Week Two: 1/10-1/14
  6. Mini-Assignment

22WI_CACC2993-Exploration Project

Mini-Assignment

Completion requirements
Opened: Thursday, 18 February 2021, 12:00 AM
Due: Wednesday, 12 January 2022, 11:59 PM

Mini-Assignment: NumPy and Pandas

Please complete the following questions.  A pdf of your Jupyter Notebook is preferred unless that currently is not working for you. This should be a quick review assignment for you. 

1.     Create a 5x7 NumPy array filled with random numbers. Use fancy indexing to access the following entries (row, col): (1,3),(4,5),(3,2), and (0,6).

2.     Explain what np.newaxis does and provide an example of how one might use it.

3.     What sorting method does np.sort use and what is its runtime complexity (Big-O)? What does this mean?

4.     Given the following NumPy array: [4,1,5,2,7,3], what are the indices of the sorted order?

5.     Using the array from #1, sort the columns.

6.     Using the array from #1, sort the rows.

7.     How is a structured array different from a traditional NumPy array, and why might one use it?

8.     Complete the following exercise – activity created by Guilherme Samora.

a.     Import two datasets: cars1 and cars2.

b.     Print the top five rows of each.

c.      Clean cars1 removing any unnamed columns (hint: loc might be helpful)

d.     How many observations exist in each dataset?

e.     Join cars1 and cars2 into one dataframe.

f.      Let’s add a column called owners consisting of random numbers from 15,000 to 73,000.

g.     Add it to the cars dataframe.

h.     Print the last five rows of the dataset.

i.       Which car has the min mpg?

j.       Which car has the max horsepower?

 


  • Assignment#2.docx Assignment#2.docx
    6 January 2022, 7:46 PM
  • cars1.csv cars1.csv
    6 January 2022, 7:46 PM
  • cars2.csv cars2.csv
    6 January 2022, 7:46 PM
◄ Class Notebook
Olympic Games Dataset ►

Moodle Help

BSC Students - Please contact the BSC Helpdesk at helpdesk@bsc.edu or 205-226-3033, option 2. If you're an online course student, please consult the IT Website for Online Course Students. 

BSC Faculty and Staff - Please visit the Instructional Technology Moodle Course or contact Angela Brooks at adbrooks@bsc.edu, 205-226-3039.

facebooklinkedininstagram

  • Moodle Home
  • MyBSC Links
    Academic Alerts (formerly Starfish) Apogee BSC Email BSC Intranet BSC Website Change Password Colleague Events Records IT Helpdesk IT Help for Online Course Students Library MobilePrint OrgSync TheSIS Time & Attendance Trakstar
  • Moodle FAQs
Built with Open LMS, a Moodle-based product.
Copyright © 2024 Open LMS, All Rights Reserved.

Data retention summary
Get the mobile app
Switch to the standard theme