Code Monkey home page Code Monkey logo

library-python-intro-deprecated's People

Contributors

aaren avatar abbycabs avatar abostroem avatar abought avatar bennet-umich avatar biologyguy avatar c-martinez avatar elliewix avatar fmichonneau avatar iimog avatar jdblischak avatar jpallen avatar jt14den avatar justbennet avatar laufers avatar lo5an avatar montoyjh avatar nikhilweee avatar ntmoore avatar pbanaszkiewicz avatar rgaiacs avatar richyvk avatar shyamd avatar snamburi3 avatar tbekolay avatar twitwi avatar upendrak avatar valentina-s avatar wking avatar ylja avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

library-python-intro-deprecated's Issues

episode 01 needs more background context

This episode immediately launches into a the nitty gritty on running stuff and doesn't have any contextual intro to Python or programming languages. Particularly no context on how python differs from things they may have encountered before, such as SQL or excel formulas.

Also, the code vs text section could use a brief statement of the mission behind Jupyter notebooks for more context behind why you might want to have formatted text and code in the same document. "Jupyter Notebooks are commonly used to capture both narrative and code for analysis projects. This process can be used for similar purposes in the classroom. You are free to capture your notes and other narrative along with your executable code." Then launch into the nitty gritty on the code versus text cells.

Handout

This lesson might benefit from making a handout of reference materials.

To do this rationalise the detail of commands/terminology under the keypoints headers for each lesson. This effectively then builds a handout at - for example http://data-lessons.github.io/library-data-intro/reference/ - which can be printed out in advance of the session (librarians love handouts!)

Make sure you make a note of this in your Instructor Notes #48

Change references to Jupyter notebooks

The decision was made some time ago (ask Belinda for details) that the Spyder IDE was going to be used for teaching Python instead of Jupyter notebooks, which had previously been used and still are in at least some Software Carpentry lessons including the gapminder lesson this lesson is based on.

I've edited the setup file to reflect this, but we will need to go through each of the episodes and replace Jupyter notebook references and examples to use Spyder instead.

e.g. Episode 1: Running and Quitting has a lot of stuff in it about running a notebook. I think we need to replace this with a quick intro to using Spyder.

jupyter use demo? or maybe better as an external link

Is it possible to embed a gif of Jupyter use or link to a short demo on youtube for those who might not have the benefit of in person instruction? I find the block of text to be a lot to parse through.

Alternatively, it might be worthwhile to find a Jupyter Project link to for these directions. Having them so detailed in this lesson means that we'll need to update it anytime the jupyter UI is changed, which sounds straight forward, but means that you'll have to be constantly monitoring it for changes.

episode 02 comments

Nothing so huge to warrant it's own issue...

  • More FYI; One of the challenges in the first lesson uses a variable in it. That challenge doesn't seem dependent on the variable assignment usage, so I suggest it is moved to the other lesson or changed so they aren't using it before introduction. Likewise, you were already using print in the first lesson with demos.
  • The transition from variables to string slicing could use some smoothing.
  • Can we change the atom examples to maybe book titles?
  • Introduction of the len() function could use more narrative. E.g. "Just like you've been using print() to make values appear on the screen, there are many more functions to perform other tasks. One of the other essentials is len(), which will return the length of what you pass it (watch out! Not all things in Python have a length). You can pass it a string or a variable for a string into the (), and len will tell you how long it is. For example, len("hello") will say 5, because there are three letters in there. Most everything in python has a length of some sort, which you'll learn about in later lessons."
  • This lesson really quickly leaves variables and assignment and goes into string processing. Some of the string slicing could be taken out to reduce the time and other examples used instead. You can spend 10+ minutes alone explaining start:stop, and it's worth taking that time as well. Maybe even making slicing into it's own episode, since it's utilized by both strings and lists. I also usually put in some added note that string[inclusive-start:exclusive-stop:step] is something just worth writing down and referencing, since it will be a very foreign concept.
  • Also, "Mathematically, you might say that a slice selects" will not resonate with a majority of librarians.

Sprint day two - Brisbane - report

Hi all

Petrina Collingwood (@prcollingwood) and I both worked on the lesson today. I cleaned up some of the config and index and started on an introduction - I'm going to carry on with that this evening.

Petrina started working through each episode changing things to be less gapminder/software carpentry, and more library carpentry - focusing on changing code examples. She looked at episdoes 2 & 3.

Then @laufers @elainewong and @weaverbel did some stuff.

There's a few outstanding issues if anyone wants to tackle them. I'm on zoom for a bit tongith so let me know if you want to chat.

Add more anaconda context

Anaconda is mentioned as a package manager without much context. Not that we need to dive into it that deeply, but I've found it worthwhile to mention that you won't directly use anaconda as an application. It installs things in the background so that commands are mostly standardized across platforms. So you'll be using anaconda pretty much anytime you run python, but it won't look like it.

I've had students skip the anaconda install and seriously question why they did it because they weren't seeing it used later on.

Provide an inspirational example

I had a half day workshop with humanities scholars this week. Towards the end of the workshop, the group was getting a bit tired and starting to struggle. In particular someone voiced his concern about slicing lists: "it is too abstract, I don't understand when this might be useful". So we spent the last 1/2 hour of the workshop with me showing them how to make a plot of the word-count of a book (code below).

Pros:

  • It made concepts a bit more concrete as I was using mostly things we had already covered during the workshop.
  • It was good for them to see "how things are done in real life": I couldn't remember how to load text from a url, so I quickly googled it -- I think it was a bit of a relief for them to see that, yes, you can google for the answer (and that you will most likely find it).

Cons:

  • I think it goes a bit against the interactive style of workshops -- I was doing all the typing and explaining what I was doing and what problems I was encountering, while they were just watching and listening. It could be very easy for people to get distracted.
  • It went a bit too fast for some people (I pasted my command history and added comments on a shared document afterwards, but still...)

Question: Is it useful to include such a demo as an inspirational example of what you can do with Python?

# This is the book we are going to work with (Dracula)
urlBook = 'http://www.gutenberg.org/cache/epub/345/pg345.txt'

# We use urllib library to load data from the web
import urllib

# We first use urlopen to connect to make our request and 
# then read the content of our response
resp = urllib.request.urlopen(urlBook)
data = resp.read()

# We have the text of the book on a variable called data, so we inspect it a bit
print(type(data))   # What is its time
print(len(data))     # How big is it?
print(data[:100])   # Let’s have a look at the first 100 letters of the data...

# We will pre-process our data a little bit
dataStr = str(data)   # convert it into a string
dataLower = dataStr.lower()  # lowercase it
dataWords = dataLower.split(' ')  # split our string after every space ‘ ‘

# Let’s have a look at how our data looks now
print(type(dataWords))   # What is the type
print(dataWords[:10])     # look at different parts of the data
print(dataWords[100:120])
print(dataWords[1100:1120])

# How we will use the python counter.
from collections import Counter

# A counter tells us how many items of which kind we have
# for example, how many 1’s, 2’s and 3’s
print(Counter([1, 1, 1, 2, 3]))

# Now we use counter to count how many times each word appears on the text
counts = Counter(dataWords)

# We can see which are the 10 most common words on our text:
print(counts.most_common(n=10))

# Now we are going to use python library matplotlib. 
import matplotlib.pyplot as plt

# First we get the convert our counts to a list and sort our list in reverse order
values = list(counts.values())
values.sort(reverse=True)

# We can have a look at the top 5 and bottom 5 counts
print(values[:5])
print(values[-5:])

# Now we can print this in a log scale
plt.loglog(values)

DISCLAIMER: this is probably not the prettiest way of doing word counts, but the aim was to illustrate the point of how to load and work with data.

remove/replace math references in episode 04

Episode 04 has several analytics/math references that are valuable clarifying statements for some groups, but will not resonate or stick with many librarians. Either because they are referencing very specific math vocabulary that is not commonly used, and referencing activities that aren't commonly part of our programming workflow.

Examples:

  • "Commonly-used built-in functions include max, min, and round."
    • This is true for numerical data processing, but not for text. Can we change this to string processing examples?
  • "“Largest of the empty set” is a meaningless question."
    • this will not be an impactful statement for many

This is worth a larger pass over to identify more, but those two were the biggest that stuck out to me.

the string library might be more relevant for 06-libraries

Episode 6 on libraries and modules uses the math library. The examples could be pretty easily rewritten using the string library. Example:

import string
print("the lower ascii letters are", string.ascii_lowercase)

I can work on a PR for this if there's approval for the change.

The challenges will also need to be changed to be less math/genomics focused. For example, the Jugsaw Puzzle to fix the code generating a random DNA base pare wouldn't be very relatable.

retool discussion on .py file extension in episode 01

Current text has: "This is convention, not a requirement."

I'd suggest either removing this or expanding it. I feel like this would open space for a tangent or questions that aren't necessary to cover for this tutorial. That said, you could retool it a bit to fend off the tangental or pedantic questions (I can't be the only one who gets those). The fact that file extensions are just a flag for your system and changing them doesn't change the contents is new information to a lot of people and can generate a lot of questions.

Possible change: "As with all file extensions, this is a convention and not a requirement."

or

"Python script files are plain text files, and thus can be opened in any plain text viewer. They are noted with a .py so software applications can recognize that they are Python, but no specific text viewer is required to view the contents."

I'd put this in as a PR, but thought it worthy of a discussion or consensus first.

Name

To keep with the theme, the name of this lesson should be 'Python Intro for Libraries'

Link to Git install

Setup assumes Git is installed. Perhaps link to Git install from that page.

Also explain how to "open a terminal or Git Bash" in tutorial (as is explained in video tutorial). Lesson assumes users know how to do this, but this might not be the case for all library employees.

move, reduce, or extract out the markdown instructions

I worry that focusing on markdown syntax so early might distract learners and take away valuable time. it's also a pretty huge amount of text on the screen. Perhaps simplify it to state that you can markup the text with markdown, and then have a side lesson on markdown in jupyter that can be referenced later. I'm a little torn about this, thus the issue.

The included commands are all good formatting things to do, but it might inspire a lengthy tangental lecture and demo. So maybe focus on two essentials: making H1 headers and single-level lists. Then linking out to a side/sub lesson for students to explore during the challenge portion, and have them expand on those tasks as part of the challenge.

Example: "Use the information from the markdown lesson to add a lower level header to your cell..."

Clean lesson

  • Remove Pandas lesson
  • Remove old introduction
  • Changes authors,
  • Change maintainers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.