Mandatory back-to-school reading 🖤:
— Mara Averick (@dataandme) August 29, 2018
"Naming Things" 🖊 @JennyBryanhttps://t.co/CGfXDSlUv1 #rstats #commonDecency pic.twitter.com/dflForPhT3
Mandatory back-to-school reading 🖤:
— Mara Averick (@dataandme) August 29, 2018
"Naming Things" 🖊 @JennyBryanhttps://t.co/CGfXDSlUv1 #rstats #commonDecency pic.twitter.com/dflForPhT3
need to sanity check residuals in a multiple regression? #broom has your back:
— alex hayes (@alexpghayes) August 26, 2018
library(tidyverse)
fit <- lm(hp ~ ., mtcars)
au <- broom::augment(fit)
au %>%
gather(x, val, -contains(".")) %>%
ggplot(aes(val, .resid)) +
geom_point() +
facet_wrap(~x, scales = "free") pic.twitter.com/3MY68ByYNx
In case you missed it: @GoogleColab can open any @ProjectJupyter notebook directly from @github!
— Jake VanderPlas (@jakevdp) August 24, 2018
To run the notebook, just replace "https://t.co/MKWVn09p42 " with "https://t.co/gLpXEaax1f " in the notebook URL, and it will be loaded into Colab.
DO THIS NOW (if you care about reproducibility) #rstats https://t.co/LbXgi2UYFA
— Hadley Wickham (@hadleywickham) August 23, 2018
(And I remove those columns before using the dataset for any kind of analysis, of course. This is just for browsing-through-large-output-while-developing purposes.)
— Data Science Renee (@BecomingDataSci) August 18, 2018
Sometimes when I have SQL queries with a whole bunch of columns, or with the same column names in different tables, I create text "divider columns" so when I'm scrolling through the output, it's clear what I'm looking at!
— Data Science Renee (@BecomingDataSci) August 18, 2018
I obviously don't name my fields this way, but for demo: pic.twitter.com/7XIB5yf4Xa
By default, Python compare objects using their ids. Consider the following class:
— Daily Python Tip (@python_tip) August 16, 2018
class Number:
def __init__(self, x):
self.x = x
n1 = Number(1)
n2 = Number(1)
n1 == n2 # False 😲😲
The elegant solution to this problem is to use #dataclasses https://t.co/wxBtxfyLPR
Wanna know which line of your function is eating all the time? Measure it with #lprun: pic.twitter.com/1NpmVNH6F1
— Daily Python Tip (@python_tip) August 15, 2018
I generally suggest the opposite. Work from a high level view of the paper, and do lots of experiments as you go and use common sense. When you're all done, compare to their implementation. I often find I come up with better ways, which I wouldn't if I were copying closely
— Jeremy Howard (@jeremyphoward) August 14, 2018
I'm revising slides for a workshop on #RMarkdown and #papaja. I have this slide on best practices. Did I forget something? pic.twitter.com/HLIIjTiOkA
— Frederik Aust (@FrederikAust) August 10, 2018
The single best thing you can do when asking for coding help online is provide a short, complete example script that others can copy, paste, and run **without any modification** to reproduce your problem.
— Jake VanderPlas (@jakevdp) August 9, 2018
This applies to StackOverflow, mailing lists, github issues... everything.
Pro Python tip from Larry Hastings: replace os.system() with https://t.co/nlqriQPg4E() to run shell commands from Python; the former does not return errors if they are thrown
— Rachael Tatman (@rctatman) August 9, 2018