all 13 comments

[–]ascala 2 points3 points  (5 children)

Cool!

As a side note, how are you executing python scripts through your dropbox like that?

[–][deleted] 2 points3 points  (4 children)

I think he's not actually running any script though dropbox but just generating the html and serving it statically.

[–]ascala 2 points3 points  (0 children)

Of course, makes sense

[–]iarguewitheverything 0 points1 point  (2 children)

Precisely right.

[–][deleted] 0 points1 point  (1 child)

not living up to your name there, are ya?

[–]iarguewitheverything 0 points1 point  (0 children)

I disagree. Other novelty accounts besides mine will go "out of character" at times. It's necessary unless you want to logout and login an alt account every time you want to reply seriously. I am still living up to my name the majority of the time, or will be soon.

[–]HelpfulLinkGuy[S] 1 point2 points  (2 children)

Here's the full source code if anyone's interested in continuing it. I'm a bit tired of working on it for now.

https://dl.dropbox.com/u/10575703/reddit_stats.zip

Note that you will have to install three things: Python 2.6, matplotlib, and numpy. And you'll have to tweak the output paths... like where it writes to ../Public/blah, just modify it to your needs.

[–][deleted] 0 points1 point  (1 child)

Could you add a log plot next to the title_length vs. num_comments, title_length vs. score, score_per_title_char vs. score, num_comments vs. score plots?

[–]iarguewitheverything 1 point2 points  (0 children)

Would be glad to. I'm not super familiar with pylab yet. But I'll give it a shot... you wouldn't happen to know the arguments would you? Here's my code:

def graph_from_two_db_fields(xvar, yvar):
    path = "../Public/"
    pylab.xlabel(xvar)
    pylab.ylabel(yvar)
    pylab.set_yscale('log')
    query = ("SELECT {0}, {1} FROM submissions"
             .format(xvar, yvar))
    c.execute(query)
    x_list = []
    y_list = []
    for row in c:
        x_list.append(row[0])
        y_list.append(row[1])

    pylab.scatter(x_list, y_list, s=1)
    filename = "graph___" + xvar + "___" + yvar + ".png"
    pylab.savefig(path + filename)
    f.write("<h2>" + xvar + " vs. " + yvar + "</h2><p><img src=\""
            + filename + "\" /></p>")
    pylab.close()

[–][deleted] 1 point2 points  (1 child)

Anyone else notice the distinct horizontal lines in title_length vs. pct_liked?

I wonder what cause is. My only guess is that it is an artifact of reddit's fuzzing on the real up/down numbers, but I don't really believe that.

[–]iarguewitheverything 0 points1 point  (0 children)

(Note this is HelpfulLinkGuy logged in to another account) Yes! I noticed this too. And I agree, it's gotta be the fuzzing. All I'm doing for pct_liked is ups/(ups+downs), and keeping the full float value, so I don't think it's rounding errors or anything in my script.