Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKAZUYA NAKAJIMA
8,851 Points"<" should be used?
In video teacher kat uses <= for direction of filter_col_by_float, but < would better to be used for function argument and number of ties < $20 will be 28, not 38.
in video:
under_20_bucks = filter_col_by_float(data_from_csv, "priceLabel", "<=", 20)
print("Found {} ties < $20".format(number_of_records(under_20_bucks)))
should be?:
under_20_bucks = filter_col_by_float(data_from_csv, "priceLabel", "<", 20)
print("Found {} ties < $20".format(number_of_records(under_20_bucks)))
KAZUYA NAKAJIMA
8,851 PointsThank you, noted what you are indicating.
3 Answers
Kat Chuang
Treehouse Guest TeacherHi @kazuyanakajima, you are correct about using < for mathematical precision.
In this example I included the ties that are priced at $20 in the sample and it is a personal preference because in the region and context of my work, we usually round up to the nearest 10. Like you brought up, it is better to explain whether < or <= was used in calculations.
MUZ140953 Herbert Samuriwo
7,929 PointsFilter all the DKNY branded ties from the data_from_csv variable into a variable named dkny_ties, using the function filter_col_by_string(). Hint: the field to filter on is called "brandName". guys anyone with the idea to this question
KAZUYA NAKAJIMA
8,851 PointsTeacher kat: well noted with thanks!
stuartholland
10,773 Pointsstuartholland
10,773 PointsMathematically you are correct. This may however, just be one of those "do as I do, not as I say" situations.