Welcome to the Treehouse Community
Looking to learn something new?
Alex Peck6,907 Points
Is anyone else who is working locally with the zip download getting a bar plot, but no table?
I'm using the download zip files and working locally. It's been fine for every lesson in the course until now. Even when I copy and paste the entire code from the workspace (with additions made in the video) I can't get my local dev setup to produce the table, only the bar plot.
However, when I do the lesson in the browser workspace the code works.
I can't figure out what I'm missing and any you could provide would be a appreciated.
James Barber3,502 Points
Check your build_table_text() function. I had a similar issue but resolved it by revising this function. Here's the code that works for me (and shows the table properly), be especially watchful of your indentation (previously, my return was indented too far, which caused my table to be limited to the first row...). NOTE: Notice the code before the code block below, not sure how to fix the markdown in my post...:
def build_table_text(data_sample, brands): cell_text =  row_text = 
unique_brand_list = sorted(set(brands)) for brand in unique_brand_list: brand = bytes.decode(brand) temp_row =  group1 = count_prices_for_brands(data_sample, brand, 0, 50) group2 = count_prices_for_brands(data_sample, brand, 50, 100) group3 = count_prices_for_brands(data_sample, brand, 100, 150) group4 = count_prices_for_brands(data_sample, brand, 150, 200) group5 = count_prices_for_brands(data_sample, brand, 200, 250) group6 = count_prices_for_brands(data_sample, brand, 250, 10000) row_list = [group1, group2, group3, group4, group5, group6] temp_row.extend(row_list) if group1 > 0: if any([x >= group1 for x in row_list[1:]]): cell_text.append(temp_row) row_text.append(brand) return cell_text, row_text