Readit News logoReadit News
ivan_ah commented on Simulating and Visualising the Central Limit Theorem   blog.foletta.net/post/202... · Posted by u/gjf
ivan_ah · 13 days ago
I love the simulations. They are such a good way to learn STATS... you can still look at the theorem using math notation after, but if you've seen it work first using simulated random samples, then the math will make a lot more sense.

Here is a notebook with some more graphs and visualizations of the CLT: https://nobsstats.com/site/notebooks/28_random_samples/#samp...

runnable link: https://mybinder.org/v2/gh/minireference/noBSstats/main?labp...

ivan_ah commented on Why Pandas feels clunky when coming from R (2024)   sumsar.net/blog/pandas-fe... · Posted by u/Tomte
ryan-duve · 3 months ago
I wonder if the author would have thought Pandas feels less clunky if they knew about `.eval`?

    import pandas as pd


    purchases = pd.read_csv("purchases.csv")

    (
        purchases.loc[
            lambda x: x["amount"] < 10 * x.groupby("country")["amount"].transform("median")
        ]
        .eval("total=amount-discount")
        .groupby("country")["total"]
        .sum()
    )

ivan_ah · 3 months ago
Or with and .assign:

    (
        purchases.loc[
            lambda x: x["amount"] < 10 * x.groupby("country")["amount"].transform("median")
        ]
        .assign(total=lambda df: df["amount"] - df["discount"])
        .groupby("country")["total"]
        .sum()
        .reset_index()  # to produce a DataFrame result
    )

ivan_ah commented on Why Pandas feels clunky when coming from R (2024)   sumsar.net/blog/pandas-fe... · Posted by u/Tomte
__mharrison__ · 3 months ago
Lots of readers of my book, Effective Pandas, say it helps them feel more like they are used to with R...

(I've never used R myself, but certainly have some very strong opinions about Pandas after having written 3 books about it.)

ivan_ah · 3 months ago
Hi Matt! Big fan. The first that I thought when I read this article was "How would Matt use his .assign-chain-kung-fu on this one" and I tried

   import pandas as pd
   purchases = pd.read_csv("https://www.sumsar.net/blog/pandas-feels-clunky-when-coming-from-r/purchases.csv")
   (purchases
     .assign(country_median=lambda df:
         df.groupby("country")["amount"].transform("median")
     )
     .query("amount <= country_median * 10")
     .groupby("country")
     .assign(total=lambda df: (df["amount"] - df["discount"]).sum())
   )
but it seems 'DataFrameGroupBy' object has no attribute 'assign' so its not that simple, though with a slight re-ordering of the chain operations, it works cf. https://news.ycombinator.com/item?id=44236487

ivan_ah commented on Math Symbol Frequencies   leancrew.com/all-this/202... · Posted by u/tosh
devrandoom · 3 months ago
I hope you irony of your comment isn't lost.
ivan_ah · 3 months ago
Hahahah... Yes, contributing to the frequency tables. At least we're not including the symbols in question in our comments, so as not add to the imbalance!
ivan_ah commented on I started a little math club in Bangalore   teachyourselfmath.app/clu... · Posted by u/viveknathani_
necessary · 3 months ago
Thanks for posting these - these books look like exactly what I have been looking for recently! I'm someone who procrastinated and crammed my way through high school and undergrad level maths and then promptly forgot all of it once I finished schooling. I plan on working through them soon. Hopefully this isn't an annoying question, but do you still intend to publish a guide to statistics?
ivan_ah · 3 months ago
> do you still intend to publish a guide to statistics?

Yes! Very much so. I'm in the final stages of cooking it right now, hoping to make it available for sale in the coming months.

Statistics is by far the hardest subject I've had to write about, as I had to (re)learn pretty much everything. I did several rewrites (working on tis book for the past seven years!), but now it's finally ready to ship. You can check out the notebooks from the book here: https://nobsstats.com/ and a detailed outline here https://docs.google.com/document/d/1fwep23-95U-w1QMPU31nOvUn...

ETA July for digital download, then one round of copy-editing, and September for first print version.

ivan_ah commented on I started a little math club in Bangalore   teachyourselfmath.app/clu... · Posted by u/viveknathani_
ivan_ah · 3 months ago
Nice to see adults (re)learning math. It's one of the rare subjects that are guaranteed to provide "knowledge buzz" and also widely applicable.

<shameless plug>For other adults interested in learning math, check out my (nonfree) book here: https://noBSmath.com/ PDF preview and sample chapter: https://minireference.com/static/excerpts/noBSmath_v5_previe... I also have a longer book that includes calculus and physics (cf. links in profile). </shameless plug>

ivan_ah commented on I started a little math club in Bangalore   teachyourselfmath.app/clu... · Posted by u/viveknathani_
ivan_ah · 3 months ago
Nice to see adults (re)learning math. It's one of the rare subjects that are guaranteed to provide "knowledge buzz" and also widely applicable.

<shameless plug>For other adults interested in learning math, check out my (nonfree) book here: https://noBSmath.com/ PDF preview and sample chapter: https://minireference.com/static/excerpts/noBSmath_v5_previe... I also have a longer book that includes calculus and physics (cf. links in profile). </shameless plug>

ivan_ah commented on How to avoid P hacking   nature.com/articles/d4158... · Posted by u/benocodes
ivan_ah · 3 months ago
Non-paywall link: https://archive.is/IJcOI
ivan_ah commented on A guide to reduce screen time   speedbumpapp.com/en/blog/... · Posted by u/nullderef
andai · 5 months ago
I used to do this every morning, for the first hour of the day.

I started doing it to cope with severe unmedicated ADHD. I found the only way I could get any work done was to turn off my phone and unplug the router.

(I downloaded offline docs, and if I got really stuck, made a note of what to Google later and just switched tasks.)

I then found that I enjoyed getting stuff done so much, that I'd usually keep it off until after lunch.

ivan_ah · 5 months ago
Very interesting.

I was thinking of scaling this up by adding Sunday too, but offline mornings might be even better... I'll look into adding a schedule in the router. I think it might be helpful to program the rule to start in the desired bedtime in the evening to make the pixel devices unexciting and incentivize reading old school books (the most efficient technology for getting me to sleep).

I've heard the advice don't touch the phone/email first thing in the morning so many times, but I can never stick to it, but if my "habit" is enforced at the network layer, I think it is doable ;)

UPDATE: Apparently iOS has a built in automation tool Shortcuts app, which allowed me to schedule this, see https://imgur.com/a/TsQJak3 I added similar rulesets to the router. Watch out world, Ivan's productivity is going to skyrocket!

u/ivan_ah

KarmaCake day5195October 14, 2008
About
ivan dot savov at gmail

Founder at Minireference Co. We make textbooks that don't suck.

No Bullshit Guide to Mathematics => https://noBSmath.com (high school math)

No Bullshit Guide to Math & Physics => https://minireference.com (mechanics and calculus)

No Bullshit Guide to Linear Algebra => http://gum.co/noBSLA (linear algebra and its applications)

___________________________________

View Original