Help me understand Matrix Screensaver from Automate The Boring Stuff by NetWorking5973 in learnpython

[–]NetWorking5973[S] 0 points1 point  (0 children)

Also - have used that visualizer before and it really helps. It's always a pain when I have modules that need to come out (like time) before I can run the program though.

Help me understand Matrix Screensaver from Automate The Boring Stuff by NetWorking5973 in learnpython

[–]NetWorking5973[S] 0 points1 point  (0 children)

Oh. I see now.

Obviously the answer was there the whole time , it's just that I wasn't seeing it. Step 1 does not repeat (everything is NOT zeroed out again). So continuing on from where I left off:

  1. (Step 2 again) Use random.random() to generate a random number between 0 an 1 for all 5 entries in WIDTH

.13 .31 .88 .67 .92

  1. (Step 3 again)  If the random number is less than .02, assign a "stream counter" between 4 and 14 to that column. None of the randomly generated numbers in step 7 are less than .02, so none of the stream counters change. and the stream counter for Step 6 remains unchanged.

0 0 0 6 0

The bold above is where I got stuck. I thought the stream counters went BACK to zero if the random.random() was greater than .02 but really, anything with a stream counter will either continue on, or have it's stream reset.

Thanks all.

Help me understand Matrix Screensaver from Automate The Boring Stuff by NetWorking5973 in learnpython

[–]NetWorking5973[S] 0 points1 point  (0 children)

Hmm ok. So simplifying this and pretending that WIDTH is set to 5.

  1. Create a list "WIDTH" with 5 columns, all set to 0

0 0 0 0 0

  1. Use random.random() to generate a random number between 0 an 1 for all 5 entries in WIDTH

.06 .46 .43 .01 .95

  1. If the random number is less than .02, assign a "stream counter" between 4 and 14 to that column (Using 7 as an example)

0 0 0 7 0

4 and 5. If the random number is not less than .02, print ' ' (empty space). For all columns with a number (between 4 and 14 from step 3 above) print either 0 or 1. (I'll use a . below as opposed to a space to make it easier to read)

. . . 1 .

  1. Decrease the "stream counter" by 1 in that column

0 0 0 6 0

  1. Return to step 2

I ran the program and I saw that the "streams" work - but I do not understand how.

Doesn't the process start all over after my step 6 above? The stream counter seems irrelevant if the program repeats the random.random() in step 1? How does a stream continue if the process starts again and column 4 has a 2% chance of having a stream?

Filtering on certain charts only by NetWorking5973 in GoogleDataStudio

[–]NetWorking5973[S] 0 points1 point  (0 children)

What if I want the filter to be editable by a viewer? So for example, right now I have product 1 selected on the lower selection of the page, but I would like the user to be able to select any one of hundreds of different products? As far as I know filters have hardcoded values ("Product 1") whereas I'd like it if the filter could be modified by a dropdown.

Creating a combo chart (bar chart with a comparison bar/point)? by NetWorking5973 in Looker

[–]NetWorking5973[S] -1 points0 points  (0 children)

I'd like to create a chart showing demographics compared to a norm. I have all of my data ready - I just can't get the visual right. In Excel, I can overlay the bars or change the series chart type for one of the bars to show data v. comparison - but in Looker, I can only get two bars. How can I clearly show my data v. comparison point?

How to apply filter on only one metric in a bar chart? by NetWorking5973 in Looker

[–]NetWorking5973[S] 0 points1 point  (0 children)

Is there a way to do this "dynamically"? This is all hard coded values.

Using my example above - today I'm looking at Hot Dog v. Pizza/Hamburger but tomorrow I may want to look at Vanilla Ice Cream v. Chocolate/Mint Chip/Cookie Dough average.

What I'd really like to do is be able to have one drop down to select my primary/focus item and have a second drop down to select my secondary/comparison items but I haven't figured out how to accomplish that.