summaryrefslogtreecommitdiffhomepage
path: root/pythonstatcomp.html.markdown
diff options
context:
space:
mode:
authorShawn Zhang <shawnzhang009@gmail.com>2016-03-15 11:42:20 +0800
committerShawn Zhang <shawnzhang009@gmail.com>2016-03-15 11:42:20 +0800
commitb38a7645366b1580b5f554303e411447c7d2d09d (patch)
treecfe5c9e59fa1f3611a5b5545f9b2d74cbac461f2 /pythonstatcomp.html.markdown
parent072424afd77b9d772102f83508fcc337ffc81a7d (diff)
parentfbe11b52d5fe839f791935012b93ff8ef2ac91f6 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'pythonstatcomp.html.markdown')
-rw-r--r--pythonstatcomp.html.markdown5
1 files changed, 2 insertions, 3 deletions
diff --git a/pythonstatcomp.html.markdown b/pythonstatcomp.html.markdown
index f8d83b98..0b02dca8 100644
--- a/pythonstatcomp.html.markdown
+++ b/pythonstatcomp.html.markdown
@@ -150,9 +150,8 @@ ggplot(aes(x="age",y="weight"), data=pets) + geom_point() + labs(title="pets")
url = "https://raw.githubusercontent.com/e99n09/R-notes/master/data/hre.csv"
r = requests.get(url)
fp = "hre.csv"
-f = open(fp, "wb")
-f.write(r.text.encode("UTF-8"))
-f.close()
+with open(fp, "wb") as f:
+ f.write(r.text.encode("UTF-8"))
hre = pd.read_csv(fp)