Class 3 – Make a list and plot it

Today we are going to
1.  learn more about lists and plot them.  Today’s files are in https://github.com/bmaillou/BigDataPython/tree/master/03-Lists

 

Here is a reading on lists.  http://www.tutorialspoint.com/python/python_lists.htm

VIDEO

QUIZ After Video-Take the quiz on courseworks.

HOMEWORK

Homework 2 Due beginning of next class (Monday September 15, 2025).

  1. Keep up with Code.org
  2. Make plots Like below.
  3. Remember to start your notebook with a nice header in Markdown with your name, homework number etc.
  4. Hand in your notebook.  It ends in .ipynb.  this lets me run your notebook if there are any issues.

Make 2 lists

x=np.array([1,2,3,4,5,6])
y=np.array([6,5,4,3,2,1])

plot x versus y.

  1. use the ax.plot nomenclature to make a plot.
  2. choose your favorite shape
  3. choose your favorite color
  4. choose your favorite linestyle.
  5. choose something else to change (e.g. linewidth…)
  6. Put your name in the axis labels
  7. Add a title with your hometown in the title
  8. Use Markdown after the graph to add a figure caption.  It can be brief but get in the habit.

This is my example but it is not perfect!!!!!  something similar will get you a 50.  You need to add the missing parts.

hw2-picture
Final 10%:  To get the final 10% of the HW credit can you make a second plot with a slope of 4 and an intercept of -2?  Remember all the parts of the first graph.  Also, remember copy and paste are your friends……  Also remember what slope and intercept are!

Class 02 – Print, Markdown, directories, lists

Goals:

  1. We are going to learn some basic programming and thinking about computers.  Today’s files are in https://github.com/bmaillou/BigDataPython/tree/master/02-Directories.
  2. First we will practice changing directories and thinking about where we work.
    1. Reminder.  If you want to download it from github right click on raw and choose save link as.  If you get a .txt file ending change it it .ipynb and you can now open it in your jupyter notebook.
  3. Second we will do Markdown, basic math, and printing

VIDEO FOR TODAY

QUIZ for after Video

  1. Remember that you need to take the quiz before class on courseworks!  It is labeled quiz 1 and called

    Quiz 1: Python Video on Directories and Printing

 

Notebook 1 Due beginning of Next class. (Wednesday September 10, 2025)

  1. Work on Code.org  to stay on track.
  2. Look at the directory structure of your computer and make a place to work from when using Python (not graded, for your own organization)
  3. In the Jupyter Notebook for your homework use Markdown to make a nice header with your name, date, assignment and other information that is relevant.  This is required of all homework.  The reason we use the notebooks is because you can add markdown to make programming understandable and reproducible.  Start practicing that from the first homework. This is critical.  You must add your name, date, section, and assignment in markdown.
  4. Use one print statement to make a capital letter of your first name.  My B out of b’s is below.  In your print statement you can use your letter, \t, \n and minimal spaces.  My example is below but you can make yours look nicer with your letter!  You need to use one print statement only on only one line!.
  5. Use print statements and .format to answer the math questions below exactly the same way with the exact formatting.  You need to set an a and b and use them in your format statement.  Your print statement cannot have numbers.  Repeat-There are no numbers in your print/format statement.  You set the a and b before the print statement.
  6. Upload your homework to courseworks.  You upload the notebook.  The file you upload should end in .ipynb.  DO NOT upload a pdf and do not upload screen shots.  There is no need to export anything.  Just go find your .ipynb notebook and upload that to courseworks.
  7. Watch Next Video and Take Quiz

 

Brian B (Really looks more like an 8)

Your answer should nicer than

BBBBB
B        B
B        B
BBBBB
B        B
B        B
BBBBB

 

Set
a=9.000
set b=4.000
Write the following sentence exactly.  using the .format nomenclature and no numbers only variables.  Use the a and b that you set in the format and print function.  Use the different operators with your variables.  Look at today’s handout for examples with the print and format functions.  The * should be in within the formatting calls.
When 9 is divided by 4.00 the answer is **2*** with a remainder of 1.0
Then to check you did it correctly.  I will open your notebook.  I will change your a=55.000 to a=4.000 and it should give me this sentence
“When 55 is divided by 4.00 the answer is **13** with a remainder of 3.0”