lecture 2 hw1 numpy arrays matplotlib and git
play

Lecture 2 - HW1,numpy arrays, matplotlib, and git 2020.4.14 Review - PowerPoint PPT Presentation

Lecture 2 - HW1,numpy arrays, matplotlib, and git 2020.4.14 Review of Python Basics from Lecture 1 Topics from Lecture 1 Lists Strings, ints, floats Dicts Objects, attributes, methods (Tuples,) Functions {sets} Importing .py


  1. Lecture 2 - HW1,numpy arrays, matplotlib, and git 2020.4.14

  2. Review of Python Basics from Lecture 1

  3. Topics from Lecture 1 Lists Strings, ints, floats Dicts Objects, attributes, methods (Tuples,) Functions {sets} Importing .py files/libraries

  4. slides, hws, solutions are posted here: neuropython.com/calendar

  5. Recorded zoom lectures will be accessible via courseworks (more fun in real time though)

  6. HW1 Solutions

  7. Numpy Arrays (see slides)

  8. Plotting with Matplotlib (see slides)

  9. %matplotlib notebook %matplotlib inline ● interactivity in old notebook ● sends png to browser ● doesn't work in jupyter lab ● no panning or zooming ● need to create separate figures ● new figure for each cell ● ability to update figures ● no changes to previous figures %matplotlib widget ● interactive widget ● all figure features ● need to create separate figures explicitly ● ability to update figures ● installation instructions: https://github.com/matplotlib/jupyter-matplotlib

  10. https://matplotlib.org/3.2.1/gallery/color/colormap_reference.html

  11. Matplotlib Resources ● Matplotlib Tutorials: https://matplotlib.org/tutorials/ ● Matplotlib Gallery: http://matplotlib.org/gallery.html ● Plotting commands summary: http://matplotlib.org/api/pyplot_summary.html

  12. Fun Resource: https://serialmentor.com/dataviz/

  13. Use perceptually uniform colormaps 😲

  14. Don’t cut the vertical axis 😲

  15. https://seaborn.pydata.org/tutorial.html

  16. Break (5 mins)

  17. Version Control with git

  18. Why version control? Nothing that is committed to version control is ever lost We have this record of who made what changes when Version control is the lab notebook of the digital world : it’s what professionals use to keep track of what they’ve done and to collaborate with other people. Every large software development project relies on it, and most programmers use it for their small jobs as well. And it isn’t just for software: books, papers, small data sets, and anything that changes over time or needs to be shared can and should be stored in a version control system https://zuckermanbrain.github.io/git-novice/

  19. Why git specifically? It is fast Work offline - decentralized, everything is on your local machine Can undo mistakes - almost every action in Git only adds data The cool kids are doing it

  20. https://xkcd.com/1597/

  21. Do not copy same code into every data folder 😲

  22. paper_v1_aggressive ... We are slaves to the myopic methods of paper_v0 paper_v1 the previous generation. We seem to share a simultaneously naive ... but nonetheless tenable belief that we Experimental and theoretical methods can “understand” or at least “interpret” and frameworks that have been paper_v1_better how each cell-type processes discarded by vertebrate researchers are information in the fruit fmy optic lobe. still treated with obeisance; ... moving bars do a poor job of revealing the mysteries of V1, but they might just work for fmies; separation of RGCs into binary ON and OFF cells is equivocal at best, but the the fmy eye might just be that simple.

  23. paper_v1_better2_advisor ... After all, how complicated can a fmy eye be? paper_v1_better2 paper_v1_better2_advisor_1 We seem to share a simultaneously naive but nonetheless tenable belief that we can “understand” or at least “interpret” We seem to share a simultaneously naive but how each cell-type processes nonetheless tenable belief that we can “understand” information in the fruit fmy optic lobe. or at least “interpret” how each cell-type processes Experimental and theoretical methods information in the fruit fmy optic lobe. Experimental and frameworks that have been and theoretical methods and frameworks that have discarded by vertebrate researchers are been discarded by vertebrate researchers are still still treated with obeisance; moving bars treated with obeisance; moving bars do a poor job of do a poor job of revealing the mysteries revealing the mysteries of V1, but they might j ust of V1, but they might just work for fmies; work for fmies; separation of RGCs into binary ON separation of RGCs into binary ON and OFF cells is equivocal at best, but the the fmy eye and OFF cells is equivocal at best, but might just be that simple. The allure of an easily the the fmy eye might just be that simple. interpretable framework is too great to resist. After The allure of an easily interpretable all, how complicated can a fmy eye be? framework is too great to resist.

  24. HEAD master git add git commit

  25. HEAD master git add git commit

  26. HEAD master br1 git branch br1 git checkout br1

  27. HEAD master br1 git add git commit

  28. HEAD br1 master git checkout master

  29. br1 HEAD master br2 git branch br2

  30. br1 HEAD master br2 git add git commit

  31. br1 br2 HEAD master git checkout br2

  32. br1 HEAD br2 master git add git commit

  33. br1 master HEAD br2 git add git commit

  34. br1 master HEAD br2 git add git commit

  35. br1 HEAD master br2 git merge br2

  36. br1 HEAD master br2

  37. “Local” version control - keeping it solo git add adds changes in the working directory to the staging area git commit records aka “gives id” to changes git branch br1 creates new branch git checkout br1 switches current workspace to branch “br1” git merge br1 merges br1 into current branch (e.g. master)

  38. git push git pull

  39. Cloning a Repository When you create a repository, it exists as a remote repository. You can clone your repository to create a local copy on your computer and sync between the two locations.

  40. Create a free, private github account https://github.com/join

  41. Git Resources https://zuckermanbrain.github.io/git-novice/ ● Thorough git tutorial (~30 min) http://rogerdudler.github.io/git-guide/ ● Very rough overview (~10 min)

  42. Aside: Extensions to Jupyter Notebook/Lab ● Hinterland - autocompletion while typing 😏 ○ https://jupyter-contrib-nbextensions.readthedocs.io/en/lat est/nbextensions/hinterland/README.html ● Variable inspector - you can see your vars!! 😃 ○ https://jupyter-contrib-nbextensions.readthedocs.io/en/lat est/nbextensions/varInspector/README.html ● Autopep8 - formatting for publishing code documentation 🤔 ○ https://jupyter-contrib-nbextensions.readthedocs.io/en/lat est/nbextensions/code_prettify/README_autopep8.html

  43. HW2 ● Plotting Coronavirus Data ○ JHU data https://data.humdata.org/dataset/novel-coronavirus-2019-ncov-ca ses ○ NYT github repo https://github.com/nytimes/covid-19-data ● Setting up your own github account ● Bonus: create a personal website with github pages https://guides.github.com/features/pages/ ○ https://jekyllthemes.io/theme/online-cv website templates

  44. https://github.com/sharu725/online-cv

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend