Git Product home page Git Product logo

fsds's People

Contributors

domweldon avatar fraterenz avatar houxiantao avatar huanfachen avatar jamesdamillington avatar jreades avatar npalomin avatar shoeboxbilly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fsds's Issues

Encoding error

There might be an encoding error (not sure). When I copy the codes on lectures/3.2-LOLs.md lines 130-134:

my_cities = [
  ['London', 51.5072, 0.1275, +0], 
  ['New York', 40.7127, 74.0059, -5], 
  ['Tokyo', 35.6833, 139.6833, +8]
]

It raised error:

    ['London', 51.5072, 0.1275, +0],
    ^
SyntaxError: invalid character in identifier

The same error raised on:
lectures/3.4-Functions.md lines 63 lines 71-75

Using notepad++ to open these .md file will see the difference.

Incorrect 1D distance formula

i2p/lectures/9.1-Data_Space.md
The formula for 1D distance is slightly incorrect, as it could result in negative values. Therefore absolute values should be used.
Instead of
$$ d(i,j) = (i_{1}-j_{1}) $$
we should use
$$ d(i,j) = |i_{1}-j_{1}| $$

Practical 3 Task 1.2.3 A functional solution

Not sure whether the difference between a global or local variable was covered in lectures or not? Either way, some students seemed confused in the implementation of the function with the naming conventions of city in both the functional definition and then calling later on when the tried to modify it. Potential solution:

def avg_tmp(city, temp):
    print(f"The average temperature in {city} is {temp}")

temp_city="Belfast"
avg_tmp(temp_city, temperatures[cities.index(city)])

Alongside this, while avg_tmp is clear in this scenario, may be worth making explicit with avg_temperature or average_temperature so that students are as clear as possible in naming their functions. Have seen some terrible function names before and this will just make it clear to students to clearly name their functions as to what they are doing.

Unneccesary declaration of `LA` variable in Practical 10

In the notebook for practical 10 where we assign a particular Borough to work with, the variable LA = 'Waltham Forest' is declared twice in sections 1.5.1 and 2.3. The latter needs to be dropped, since while changing the scope in the former declaration to a different borough is recommended, the latter impacts the title of the matplotlib plot which causes incorrect titles.

urlopen error

lectures/Practical-03-Foundations_2.ipynb TOC Task 3.1. Reading a Remote File

I ran the following code and got an error URLError: <urlopen error [Errno 11004] getaddrinfo failed>

from urllib.request import urlopen

# Given the info you were given above, what do you 
# think the value of 'url' should be? What
# type of variable is it? int or string? 
url = 'https://github.com/jreades/i2p/raw/master/data/2020-08-24-sample-listings-simple.csv'

# Read the URL stream into variable called 'response'
# using the function that we imported above
response = urlopen(url)

# Now read from the stream, decoding so that we get actual text
datafile = response.read().decode('utf-8')

# You might want to explore what `__class__` and `__name__`
# offer, but basically the give us a way of finding out what
# is 'behind' more complex variables
print("datafile variable is of type: '" + datafile.__class__.__name__ + "'.\n")

It seems to be a proxy error as described here.

I tried to use different url url = "https://raw.githubusercontent.com/jreades/i2p/master/data/2020-08-24-sample-listings-simple.csv, but it failed.

Mean calculation

lectures/2.2-Principles_of_Programming.md line 121 and line 169

  count = count = 1

should be

  count += 1

Missing colons

My bad. The task is to find mistakes. Sorry!
Just noticed a mistake in lecture notes 2.3 (see attached image). Should have colons after "else".
Screenshot 2020-10-14 at 13 55 00

Practical 3 Task 1.1 Answers

The solution to define avg_tmp in Task 1.1 does not use the input 'temp' in the function itself.

Proposed solution in workbook:
def avg_tmp(city, temp):
print(f"The average temperature in {city} is {temperatures[cities.index(city)]}")

city="Edinburgh"
avg_tmp(city, temperatures[cities.index(city)])

However, I think it should be temp within the print function, considering that we are passing the temp index. Otherwise, we don't really need the second input. It should work without it.

So, instead:

def avg_tmp(city, temp):
print(f"The average temperature in {city} is {temp}")

city="Edinburgh"
avg_tmp(city, temperatures[cities.index(city)])

Warm regards,
Divya

Assessment date

Hi, I was wondering whether you haven't changed the submission date for Assessment 2 and 3 (Data+Policy Briefing and Individual Reflection) or not because the due is 18 January 2022? Is it supposed to be 18 January 2023?

Indentation style

I notice that different indentation styles were used in file lectures/2.3-Python_the_Basics.md. For example:
Four spaces on lines 225-228

if x < y:
    print("x is less than y")
else:
    print("x is not less than y"

and two spaces in other files.

This may get confusing. By the way, I think an introduction to the indentation style of python will be helpful for beginners.

https://docs.python.org/2.0/ref/indentation.html

Import os one block earlier

In task 1.2 import os is done in the second code block where os is used in the first code block so it needs to be imported one line earlier

Task 3.3

Minor issue, but Task 3.3 talks about the population of Sheffield when we have been working with Bangor and I don't think Sheffield is in the dataset -- suspect Sheffield comes from a previous iteration of this practical

Slim "functional solution" causing confusion

There has been some confusion about Practical 3 Section 1.2.3. Students have been making the functional solution more complicated than it needs to be.

At the moment, the function is just a print statement – so could do with a clarification about how this, or could add the indexing into the function body (def city_avg_temp(city, temperatures).

Link:

{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 1.2.3 A Functional Solution \n",
"\n",
"Can you convert this to a simple function called `avg_tmp` with two inputs and then use this to print the average temperature for Edinburgh? "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def ??(??, temp):\n",
" print(f\"The average temperature in {??} is {temp}\")\n",
"\n",
"city=\"Edinburgh\"\n",
"avg_tmp(city, ??)"
]
},

Use of UCL account for github

Student lose access to their email once they graduate (potentially) so github should be set up with their personal email and then go through to add their UCL email separately to benefit from GitHub education benefits. Most will not make use of the github student benefits while they here anyway so having it on their personal account will probably be better to ensure that they still have access to it, even when they leave.

radius calculation

lectures/Practical-02-Foundations_1.ipynb TOC 3.3 Applying What We've Learned

Calculate radius for a sphere of a given volume.

The formula is:

Using the following code,

v = 14137
r = pow((3*v)/(4*math.pi),1/3)

print(round(r,0)) # result 15.0

result is 15 not 11.

Error in calculating the centre of the map

Task 3.4 in Practical-06:

xctr should be -0.1050000... but not -0.109999...

from math import floor, ceil

# Calculate min and max to two decimal points
xmin = floor(pdf['longitude'].min()*100)/100
xmax = ceil(pdf['longitude'].max()*100)/100
ymin = floor(pdf['latitude'].min()*100)/100
ymax = ceil(pdf['latitude'].max()*100)/100

print(xmin, xmax, ymin, ymax) ## -0.5 0.29 51.29 51.69

# Calculate the centre of the map
yctr = (ymax+ymin)/2
xctr = (xmax+xmin)/2  ## xctr = (0.29 + -0.5)/2 = -0.105000...

print(xctr, yctr)  ## -0.10500000000000001 51.489999999999995

Prac04,Task2.5.2

prac 04, task2.5.2.md

def to_type(cdata, ctype):
    # If a string
    if isinstance(cdata, str):
        try:
            if ctype==bool:
                return cdata==True

In this part, when cdata='True' and ctype='bool', it will never and ever return True. Cuz a string 'True' won't equals a bool True.
So it should be

return cdata == True

Prac 4, Task 5.2

Prac 4, Task 5.2

!touch dtools/init.py

Comment out so we don't automatically re-run this code every time

!jupyter nbconvert --ClearOutputPreprocessor.enabled=True
--to python --output=dtools/notebook.py
Practical-04-Objects.ipynb

Instead of Practical-04-Objects-Answers.ipynb

Practical 3 Task 4.1.2 broken down into respective parts

In practical 3, task 4.1.2, setting everything up to run on one line can often be confusing and difficult to know what is happening. While students have just learned how to do this, it can seem relatively simple to know what goes where, but putting everything on one line teaches bad practices and can be especially hard to debug for students if an error is thrown (i.e. it could come from anywhere in the line). Suggest it is broken down into respective steps (just as we taught in the previous task) to make it clearer to students what they should be aiming for and best practices. See the potentially suggested code below:

import numpy as np

# Find the latitude of Manchester.
city = "Lerwick"
city_index = myData['Name'].index(city)
city_lat = myData["Latitude"][ 
    city_index
]
print(f"{city}'s latitude is {city_lat}") # Notice how 'f-strings' work!

# # Find the easternmost city
max_long = np.max(myData["Longitude"])
max_long_position = myData["Longitude"].index( max_long)
city = myData['Name'][ max_long_position ]
print(f"The easternmost city is: {city}")

# # Print the location of Lerwick
city = "Lerwick"
print(f"The town of {city} can be found at " + 
      f"{abs(myData['Longitude'][myData['Name'].index(city)])}ºW, {myData['Latitude'][myData['Name'].index(city)]}ºN")

# # Find the mean population of the cities
# # using a handy package called numpy
mean = np.mean(myData['Population'])
print(f"The mean population is: {mean}")

Docker connection issue

Some students, if they do not open up the app, will not be able to used docker commands (either through the bash script or in their own terminal) until they open up the desktop app themselves. It could be added as an extra step just to see that docker runs on their laptop and removes a likely error.

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.