Skip to content

Turning in mini project 1#3

Open
brennanvhoek wants to merge 1 commit intosd16fall:masterfrom
brennanvhoek:master
Open

Turning in mini project 1#3
brennanvhoek wants to merge 1 commit intosd16fall:masterfrom
brennanvhoek:master

Conversation

@brennanvhoek
Copy link

No description provided.

Copy link

@matthewruehle matthewruehle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting/style recommendations. You don't have to, but you've got a chance to change them around before grades/evaluation stuff gets done!

Takes in a string and value find and returns a list of tweets the value
long that contain the string
"""
from pattern.web import Twitter
Copy link

@matthewruehle matthewruehle Oct 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's typically best practices to import outside of functions, especially if the function may be called more than once.

Takes in a hashtag and returns the average sentiment of a number of tweets
with that hashtag
"""
from pattern.en import *

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above; importing functions at the top of the python file is preferred.
Also--it's fine here I think, but in general importing * is a bad idea. Lots of libraries will have many different functions, and weird things can happen if multiple functions get the same names.


senti_avg = (sentiment_sum[0]/tweet_count, sentiment_sum[1]/tweet_count)
# print sentiment_sum
# print tweet_count

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments are good, but commented-out lines are usually worth deleting before submitting stuff.

i = tweet.id
return tweets

def hastag_setiment(hashtag):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"hastag_setiment"?
As long as functions have consistent names, it's not super important what they are--but, this seems like it miiiight be a typo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants