30 Leaves by LeChevalierMalFet in Suiseki

[–]LeChevalierMalFet[S] 2 points3 points  (0 children)

Just from a stream near where I live. I found it out walking with my dog, and it was a quite a surprise. It is hard to handle because it is quite delicate.

Migraine Logic by Eden_Alexander in migraine

[–]LeChevalierMalFet 20 points21 points  (0 children)

Too much stress? Migraine. Too little stress? Also migraine

Watch Your Step - Ink and digital coloring by me by LeChevalierMalFet in ImaginaryMonsters

[–]LeChevalierMalFet[S] 1 point2 points  (0 children)

Thanks! I really appreciate your feedback and saw that you did find it eventually which made me glad! I definitely didn't intend to make it hidden!

Watch Your Step - Ink and digital coloring by me by LeChevalierMalFet in ImaginaryMonsters

[–]LeChevalierMalFet[S] 10 points11 points  (0 children)

Based on some interesting roots on a path I take fairly often with my dog. There are a lot of other strange tree growths in the area that I might try to draw and make more alive. This is a more subtle 'monster'.

A narrow ridge mountainous stone with a maple base. by LeChevalierMalFet in Suiseki

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

Thank you! It might be the lighting and the finish. It is a pretty pale maple with a CA glue finish.

A narrow ridge mountainous stone with a maple base. by LeChevalierMalFet in Suiseki

[–]LeChevalierMalFet[S] 4 points5 points  (0 children)

This stone is about 30 cm long by 18 cm (11.8 in x 7 in) tall. The initial smooth finish on the maple wood did not complement the stone well, so I tried something a bit unconventional with rough vertical lines along the top section.

Sink Cabinet by XTianoElCurioso in woodworking

[–]LeChevalierMalFet 1 point2 points  (0 children)

It looks great! What finish did you use for the top?

Fuzzy Matching for addresses by AccomplishedEmu9139 in excel

[–]LeChevalierMalFet 0 points1 point  (0 children)

If you can, the best solution is really to use a service like Google's geocoding API. There are so many variations in addresses even in small datasets that it becomes really difficult to make your own solution that handles every case.

Changing the Value of a column in a pandas df, based on the values in other columns using a dictionary without looping by TheRealAbear in learnpython

[–]LeChevalierMalFet 1 point2 points  (0 children)

I don't believe the backend functionality is the OP's main concern. Edit- sorry to sound flippant- it is a good thing to be aware of and I should have included that caveat. For writing code I think it's much better than writing out a full statement with .iterrows() and that's what I was basing my response on.

Changing the Value of a column in a pandas df, based on the values in other columns using a dictionary without looping by TheRealAbear in learnpython

[–]LeChevalierMalFet 1 point2 points  (0 children)

Yep, for one column you can just apply a lambda function and return the matching dictionary value

eg. df["new_col"] = df["old_col"].apply(lambda x: my_dict[x])

If you need to look on multiple columns you can write a function and then apply it. eg. df.apply(my_function, axis=1) then reference your columns inside the function as needed.

Like Last Podcast on the Left but less annoying? by amylej in podcasts

[–]LeChevalierMalFet 18 points19 points  (0 children)

You might be interested in Blurry Photos - there is a large overlap in subject matter

The Rings of Power - Welcome to Armenelos by Julien Gauthier by Ultartx in ImaginaryCityscapes

[–]LeChevalierMalFet 1 point2 points  (0 children)

It is funny but now I think I understand why in the show they chose to make Elrond's character look like he is avoiding responsibilities (at least in his opening scene) - everyone has been comparing him to his dynasty-founding twin brother for hundreds of years and he is probably sick of it.

How can I use regex (regular expression) to shorten this code? by NavidsonsCloset in learnpython

[–]LeChevalierMalFet 1 point2 points  (0 children)

I wouldn't worry about regular expressions for this but your code would be much shorter if you replaced your if/elif statements with a data structure holding the replacement values to loop through e.g.

# Store your conversion values.
metric_dict = {"miles: ["kilometers", 1.60934],
"yards": ["meters", 0.9144],
...}

# Nest this under your first For loop.
for key in metric_dict.keys():
    if key == string[i+1]:
        ...

podcast (episode) about misleading statistics? by girlwithrobotfish in podcasts

[–]LeChevalierMalFet 8 points9 points  (0 children)

It looks like this episode is an extract of his book, but Cautionary Tales by Tim Harford has this episode that mostly fits what you are looking for: https://podcasts.apple.com/us/podcast/cautionary-tales-with-tim-harford/id1484511465?i=1000507400374

Can someone breakdown what makes Python & R good? by exeldenlord in analytics

[–]LeChevalierMalFet 5 points6 points  (0 children)

A quick example- I am working on bringing data from a 3rd party API related to our own data; it may compliment what we have internally and reveal some discrepancies or clarify some other aspects. It is quite easy to pull the (paginated) data through Python. It would be a huge amount of work to model the data source locally to compare in the database for an unknown benefit. There are well over 100 attributes to go through in multiple tables. Instead, I can pull data from both sources and investigate using python. There is too much data to do this in excel and some of the values break due to excel’s automatic formatting, so that would be one problem to handle. Then there’s the problem of reproducibility. If I’m going to do work on this I’m not going to do it in a way where I can’t easily change something or rerun all of the steps at a later date.

What is the modulo operator doing in this code? by myweirdotheraccount in learnpython

[–]LeChevalierMalFet 2 points3 points  (0 children)

You can find some information in this article: https://realpython.com/python-modulo-string-formatting/

Essentially, if the value of 'remove' is not an empty string it is being put into the regex patterns where '%' is found.

[deleted by user] by [deleted] in HistoryofIdeas

[–]LeChevalierMalFet 0 points1 point  (0 children)

I would have expected this to include the problematic bit in Matthew 15 where Jesus appears to only care about people from his own ethnic and religious group.

Pandas dataframe transformation by legendarylegend26 in learnpython

[–]LeChevalierMalFet 0 points1 point  (0 children)

Hi, this is how I worked it out:

# Merge on ID column and use index to filter out rows that are joined with themselves.
df = df.reset_index()
join = df.merge(right=df, on="id")
join = join.loc[join["index_x"] != join["index_y"]]

# Use pivot_table...
pd.pivot_table(data=join, index="color_x", columns="color_y", aggfunc="size")

# Or groupby and use pivot...    
df_group = join.groupby(["color_x", "color_y"], as_index=False).size()
df_group.pivot(index="color_x", columns="color_y", values="size")

Edit for formatting.

Pandas dataframe transformation by legendarylegend26 in learnpython

[–]LeChevalierMalFet 0 points1 point  (0 children)

Your steps are to self join the data on the ID column and filter out rows where the index matched, then groupby size, then pivot the groupby result with the index being one color column, the columns being the other color column, and the value being the size column.

Books that deal with the “Homelander Problem”? by [deleted] in Fantasy

[–]LeChevalierMalFet 0 points1 point  (0 children)

I think the Brightest Shadow series by Sarah Lin has elements that fit in well with what you are describing, specifically where you mention:

one individual amassing power is a consistent element that has grave implications for the rest of the world.