Code Monkey home page Code Monkey logo

python-mastery's Issues

Slides comments

Hi David, first of all thanks for providing this course, it’s been great so far (currently chapter 6).

I just wanted to share some comments/questions that came up while looking at the slides:

  1. In the slide 3-77 there is an extra handler in formatter = TextTableFormatter(handler)

  2. The MRO of 4-21 doesn't match the hierarchy previously defined

    • If E was intended, I think it should be (__main__.E, __main__.C, __main__.A, __main__.D, __main__.B, object)
    • If D was indeed intended, I think it should be (__main__.D, __main__.B, object)
  3. In 5-14 the following is mentioned:

    Important: there are no type signatures or other details to help people reading your code. If you can help clarify, that's usually good.

    Type hints although not enforced by python exist so it can help (they’re even mentioned on the next slide), so imo the sentence may be confusing

WhatsApp

Welcome!

Use discussions to:

  • Ask questions about the course
  • Share ideas and interesting resources.
  • Engage with other members who are working on the course material.

I'm not always available to answer detailed course questions, but perhaps discussions can be used as an ongoing knowledge base for the course.

Cheers,
Dave

Originally posted by @dabeaz in #1

JS

WHERE CAN I GET JAVASCRIPT LIKE THIS PLEASE?

typo in slide 2-71

After reassignment of a = [4, 5, 6], b still pointing to [1, 2, 3] should have a memory ref = 2 but slide says ref = 1.

Screen Shot 2023-08-15 at 2 17 06 PM

Typo in slide 3-68 ?

In the example for context manager.

Shouldn't the following:

if type:
    print('An exception occurred')

be instead

if ty:
    print('An exception occurred')

slide 2-44: squares() is not called

Thank you very very much for this material. It's amazing! I'm super grateful for it.

I think I spotted a small error in the code on slide 2-44:

-for n in squares:
+for n in squares([1, 2, 3, 4, 5]):

I think the squares should be called to be effective.

Thank you again for sharing your knowledge.

Slide I.II: Block comments in Python

In slide I.II it is mentioned:

There are no block comments in Python (e.g., /* ... */).

While triple quotes are technically strings not comments, they could serve the same purpose as block comments? do you think this is worth mentioning?

Thank you

dicts are ordered

In PythonMastery.pdf page 2-6, the sentence An unordered set of values indexed by "keys" should be changed, because dictionaries are ordered since Python 3.6

Add answers to ex2_2

Even if you don't include an implementation, you should include the correct results for the exercise prompt.

How many bus routes exist in Chicago?

'Number of unique routes:'
181

How many people rode the number 22 bus on February 2, 2011? What about any route on any date of your choosing?

'Number of route 22 riders on 02/02/2011:'
[Row(route='22', date='02/02/2011', daytype='W', rides=5055)]

What is the total number of rides taken on each bus route?

'Most popular routes:'
[('79', 133796763), ('9', 117923787), ('49', 95915008)]

What five bus routes had the greatest ten-year increase in ridership from 2001 to 2011?

'Route with most increase in passengers between 2001 and 2011:'
[('15', 2732209),
('147', 2107910),
('66', 1612958),
('12', 1612067),
('14', 1351308)]

Missing recommendation in Exercise 7.2

The Discussion at the end of Exercise 7.2 says the following:

Writing robust decorators is often a lot harder than it looks. Recommended reading:

However, there's no recommendation. Perhaps it was omitted accidentally?

ex2_5 collections.Sequence

Thanks for the helpful course.
Small issue I ran into in exercise 2_5 in:

import collections
class RideData(collections.Sequence):

Gave me an attribute error running python 3.11 on a windows machine.
This is due to:

`DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated 
since Python 3.3, and in 3.10 it will stop working` 

This issue provides more detail.
adding

'import collections.abc'  

and

'class RideData(collections.abc.Sequence)'

Solves this

Cannot run solution for 1_3 pcost.py - FileNotFoundError

The relative path is written as ../../Data/portfolio.dat, but unfortunately this results in a FileNotFoundError: [Errno 2] No such file or directory: '../../Data/portfolio.dat'. In my solution I had to use the pathlib library to construct a path as such:

root_dir = Path(__file__).resolve().parent.parent.parent
relative_dir = 'Data/portfolio.dat'
filename = root_dir / relative_dir
f = open(filename, 'r')```

add topics

I suggest adding the topics tutorial, python-tutorial in the About section. Thanks for your project.

Missing information in exercise 2.5 (e) Challenge

Your challenge is to modify the RideData class, however to show the expected result you use readrides.read_rides_as_columns() as an example and this method does not currently return a RideData object...

Should this method also be modified to return a RideData object? Otherwise modifying RideData will have no affect on the output of readrides.read_rides_as_columns() ?

It's probably going to look a little crazy. Can you modify
the `RideData` class so that it produces a proper slice that
looks like a list of dictionaries? For example, like this:
```python
>>> rows = readrides.read_rides_as_columns('Data/ctabus.csv')
>>> rows
<readrides.RideData object at 0x10f5054a8>

Exercise 5.4 Need help with eliminating names from typedproperty

In the last challenge of this exercise, we are asked to eliminate the need for providing names to typedproperty. I can't get this to work with the closure template provided. Can I get some more hints or just the solution, as I have been banging my head against this problem for a couple of hours now? I realize that __set_name__ is called under the hood when assigning properties to the class, and this was pretty clear in the valiidate.py exercise. I'm unsure how this works when extending the class with these typedproperty methods. Thanks for the help.

Slide 3-75 in pdf: Wording of handler usage

The handler is the same object isn't it?

Should the sentence:

Notice how various steps of the algorithm are deferred to a separate handler object

Be phrased:

Notice how various steps of the algorithm are deferred to a separate (method|function) of the handler object

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.