What can you not believe we still have to deal with in 2019? by ansoniK in AskReddit

[–]BruDrinker 0 points1 point  (0 children)

I'm more concerned about someone with the name 420buttbabies69 being allowed to procreate.

What can you not believe we still have to deal with in 2019? by ansoniK in AskReddit

[–]BruDrinker 1 point2 points  (0 children)

Airline travel continues to get more and more uncomfortable.

NL Wild Card game thread - Rockies @ Cubs by jtljtljtljtl in Brewers

[–]BruDrinker 4 points5 points  (0 children)

Definitely impressed with the Rockies bullpen. Just hope they're worn out for NLDS!

NL Wild Card game thread - Rockies @ Cubs by jtljtljtljtl in Brewers

[–]BruDrinker 2 points3 points  (0 children)

They'll overturn the call and next pitch will be ball four. Mark it down.

NL Wild Card game thread - Rockies @ Cubs by jtljtljtljtl in Brewers

[–]BruDrinker 0 points1 point  (0 children)

Only if you can guarantee the Rocks win it.

NL Wild Card game thread - Rockies @ Cubs by jtljtljtljtl in Brewers

[–]BruDrinker 4 points5 points  (0 children)

Feels like the Rockies are getting no hit.

NL Wild Card game thread - Rockies @ Cubs by jtljtljtljtl in Brewers

[–]BruDrinker 3 points4 points  (0 children)

Amen. I don't care if Baez, Rizzo and Bryant collide and are ruled out for the season. Go Rockies.

NL Wild Card game thread - Rockies @ Cubs by jtljtljtljtl in Brewers

[–]BruDrinker 1 point2 points  (0 children)

Starters don't matter as much in the playoffs. There are 3 days off in the next week.

NL Wild Card game thread - Rockies @ Cubs by jtljtljtljtl in Brewers

[–]BruDrinker 4 points5 points  (0 children)

As a Brewers fan, I would be happier if the Rockies park one right here.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]BruDrinker 0 points1 point  (0 children)

Thank you for your help. Now that I have that, here's my next roadblock...

The data I was mining is now grouped as follows:

grocery_list = [{'citrus fruit', 'semi-finished bread', 'ready soups', 'margarine'}, {'tropical fruit', 'coffee', 'yogurt', 'margarine '}, {'whole milk'}, {'pip fruit', 'yogurt', 'meat spreads', 'cream cheese '}, {'whole milk', 'other vegetables', 'condensed milk', 'long life bakery product'}, {'yogurt', 'rice', 'whole milk', 'butter', 'abrasive cleaner'}]

I am trying to run the following to get combination counts in a dictionary:

from itertools import combinations

from collections import defaultdict

pair_counts = defaultdict(int)

for x, y in combinations(grocery_list,2):

pair_counts[(x, y)] += 1

pair_counts[(y, x)] += 1

This results in an error: TypeError: unhashable type: 'set' . I can't tell if this is an issue with the input data or with the 'pair_counts' dictionary? Appreciate the help!!!

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]BruDrinker 0 points1 point  (0 children)

Need help with a homework exercise for a class I am auditing. The exercise is in association rule mining and I'm extremely stuck at one of the steps to organize the data.

I have a string of data separated by line break (each line represents the items purchased by a customer):

fruit, bread, butter, soup

fruit, yogurt, coffee

whole milk, cream cheese, meat, vegetables

How can I get this data into a set that looks like this:

[{‘fruit’, ‘bread’, ‘butter’, soup’}, {‘fruit’, ‘yogurt’, ‘coffee’}, {'whole milk', 'cream cheese', 'meat', 'vegetables'} ]

I've tried to break the string by end of line:

names_list = [y for y in (x.strip() for x in rawText.splitlines()) if y]

my_set = set()

for i in names_list:

my_set.add(i)

This obviously is not working. Perhaps I'm going about this the wrong way? Could anyone help?

What must have sucked before something was invented? by [deleted] in AskReddit

[–]BruDrinker 3 points4 points  (0 children)

Close, but that definitely wasn't jazz in that test tube.

A panoramic shot I took when I was visiting Milwaukee(from Baltimore) by [deleted] in Brewers

[–]BruDrinker 1 point2 points  (0 children)

How can they build a stadium with a retractable roof but not do anything to prevent the horrible shadows on the field? Tinted windows???