data-lessons / library-python-intro-deprecated Goto Github PK
View Code? Open in Web Editor NEWREPO NOW MOVED > https://github.com/LibraryCarpentry/lc-python-intro
Home Page: https://github.com/LibraryCarpentry/lc-python-intro
License: Other
REPO NOW MOVED > https://github.com/LibraryCarpentry/lc-python-intro
Home Page: https://github.com/LibraryCarpentry/lc-python-intro
License: Other
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.
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
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.
This is from the PYCAR Python course for journalists - from @elainewong
https://github.com/ireapps/pycar
Good basics for us to 'borrow', @richyvk @prcollingwood ?
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.
Nothing so huge to warrant it's own issue...
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.
Ordering of assigning variables and data types is perhaps not the best.
One suggestion would be to swap episodes 2 and 3.
Another suggestion would be to break down episode 2 and 3 in different blocks and ordering in a logical flow order.
For instance, have a look at http://nbviewer.jupyter.org/github/fbkarsdorp/python-course/blob/master/Chapter%201%20-%20Getting%20started.ipynb
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.
Alter the index.md page
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:
Cons:
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.
Making an issue to go along with @richyvk day one report (data-lessons/library-python-intro-superseded#2).
I'm going to get started on this, but anyone else can jump in if they want!
The section in episode 3 on "Strings have a length (but numbers don't)." might be better off in episode 2 when len()
is first introduced.
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:
This is worth a larger pass over to identify more, but those two were the biggest that stuck out to me.
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.
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.
To keep with the theme, the name of this lesson should be 'Python Intro for Libraries'
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.
This lesson would benefit from more details Instructor Notes http://data-lessons.github.io/library-python-intro/guide/. These are helpful for passing on lesson specific tips to potential instructors. See http://data-lessons.github.io/library-data-intro/guide/ for an example of how this might be done.
Episode 11 uses a lot of continuous data analysis examples. This should be updated to more text processing examples.
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..."
Repost @richyvk's report here data-lessons/library-python-intro-superseded#2
Please edit to follow template at, for example, https://github.com/data-lessons/library-shell/blob/gh-pages/README.md
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.