Python project

Jerry Shen
wshen.pdf

import pandas as pd

def process_hashes(tweet): hashtaglist = []

for word in tweet.split(): if word[0] == ’#’: hashtaglist.append(word)

return hashtaglist

if __name__ == ’__main__’: file = pd.read_csv(’data 2.txt’, sep=’\t’) for index,line in file.iterrows(): print(process_hashes(line[’Tweet’]))

import pandas as pd

def process_hashes(tweet): hashtaglist = []

for word in tweet.split(): if word[0] == ’#’: hashtaglist.append(word)

return hashtaglist

if __name__ == ’__main__’: file = pd.read_csv(’data 2.txt’, sep=’\t’) for index,line in file.iterrows(): print(process_hashes(line[’Tweet’]))

....................................... ---------------------------------------------------------------------- Ran 39 tests in 0.003s

OK

Test graph_usage above 1 name ’graph_usage’ is not defined Testing failed.

Test graph_usage above 2 name ’graph_usage’ is not defined Testing failed.

Test graph_usage no hash name ’graph_usage’ is not defined Testing failed.

Test hash_all Input was #TURTLE #TOMATO #POTATO #TORTOISE Return value was [’#TURTLE’, ’#TOMATO’, ’#POTATO’, ’#TORTOISE’] Lists differ: [’#TURTLE’, ’#TOMATO’, ’#POTATO’, ’#TORTOISE’] != [’TURTLE’, ’TOMATO’, ’POTATO’, ’TORTOISE’]

First differing element 0: ’#TURTLE’ ’TURTLE’

- [’#TURTLE’, ’#TOMATO’, ’#POTATO’, ’#TORTOISE’] ? - - - -

+ [’TURTLE’, ’TOMATO’, ’POTATO’, ’TORTOISE’] Testing failed.

Test hash_all_regex name ’process_hashes_regex’ is not defined Testing failed.

Test hash_alternating Input was #TURTLE TOMATO #POTATO TORTOISE #ALPHABET Return value was [’#TURTLE’, ’#POTATO’, ’#ALPHABET’] Lists differ: [’#TURTLE’, ’#POTATO’, ’#ALPHABET’] != [’TURTLE’, ’POTATO’, ’ALPHABET’]

First differing element 0: ’#TURTLE’ ’TURTLE’

- [’#TURTLE’, ’#POTATO’, ’#ALPHABET’] ? - - -

+ [’TURTLE’, ’POTATO’, ’ALPHABET’] Testing failed.

Test hash_alternating_regex name ’process_hashes_regex’ is not defined Testing failed.

Test hash_case Input was TURTLE #tOmAtO #potato Return value was [’#tOmAtO’, ’#potato’] Lists differ: [’#tOmAtO’, ’#potato’] != [’TOMATO’, ’POTATO’]

First differing element 0: ’#tOmAtO’ ’TOMATO’

- [’#tOmAtO’, ’#potato’] + [’TOMATO’, ’POTATO’]

Testing failed.

Test hash_case_regex name ’process_hashes_regex’ is not defined Testing failed.

Test hash_contiguous Input was TURTLE TOMATO #POTATO #TORTOISE ALPHABET Return value was [’#POTATO’, ’#TORTOISE’] Lists differ: [’#POTATO’, ’#TORTOISE’] != [’POTATO’, ’TORTOISE’]

First differing element 0: ’#POTATO’ ’POTATO’

- [’#POTATO’, ’#TORTOISE’] ? - -

+ [’POTATO’, ’TORTOISE’] Testing failed.

Test hash_contiguous_regex name ’process_hashes_regex’ is not defined Testing failed.

Test hash_duplicates Input was TURTLE TOMATO #POTATO #POTATO #TORTOISE ALPHABET #APPLE #TORTOISE APPLE Return value was [’#POTATO’, ’#POTATO’, ’#TORTOISE’, ’#APPLE’, ’#TORTOISE’] Lists differ: [’#POTATO’, ’#POTATO’, ’#TORTOISE’, ’#APPLE’, ’#TORTOISE’] != [’POTATO’, ’POTATO’, ’TORTOISE’, ’APPLE’, ’TORTOISE’]

First differing element 0: ’#POTATO’ ’POTATO’

- [’#POTATO’, ’#POTATO’, ’#TORTOISE’, ’#APPLE’, ’#TORTOISE’] ? - - - - -

+ [’POTATO’, ’POTATO’, ’TORTOISE’, ’APPLE’, ’TORTOISE’] Testing failed.

Test hash_duplicates_regex name ’process_hashes_regex’ is not defined Testing failed.

Test hash_internal Input was TURTLE #Tomaato Tom#aato TURT#le Return value was [’#Tomaato’] Lists differ: [’#Tomaato’] != [’TOMAATO’]

First differing element 0: ’#Tomaato’ ’TOMAATO’

- [’#Tomaato’] + [’TOMAATO’] Testing failed.

Test hash_none Input was Link looking at is http://data.github.com Return value was []

Test hash_none_regex name ’process_hashes_regex’ is not defined Testing failed.

Test hash_punct Input was TURTLE #TOMATO! #PO?TATO turtle tortoise #HEL,LO

Return value was [’#TOMATO!’, ’#PO?TATO’, ’#HEL,LO’] Lists differ: [’#TOMATO!’, ’#PO?TATO’, ’#HEL,LO’] != [’TOMATO’, ’POTATO’, ’HELLO’]

First differing element 0: ’#TOMATO!’ ’TOMATO’

- [’#TOMATO!’, ’#PO?TATO’, ’#HEL,LO’] ? - - - - - -

+ [’TOMATO’, ’POTATO’, ’HELLO’] Testing failed.

Test join_tweets_lc_mult_mult name ’join_tweets_lc’ is not defined Testing failed.

Test join_tweets_lc_single name ’join_tweets_lc’ is not defined Testing failed.

Test join_tweets_lc_single_mult name ’join_tweets_lc’ is not defined Testing failed.

Test empty file name ’popular_tweets’ is not defined Testing failed.

Test mult_users_mult_tweet name ’popular_tweets’ is not defined Testing failed.

Test mult_users_mult_tweet_count name ’popular_tweets’ is not defined Testing failed.

Test mult_users_mult_tweet_count_mixed name ’popular_tweets’ is not defined Testing failed.

Test mult_users_mult_tweet_mixed name ’popular_tweets’ is not defined Testing failed.

Test mult_users_one_tweet name ’popular_tweets’ is not defined Testing failed.

Test mult_users_one_tweet_count name ’popular_tweets’ is not defined Testing failed.

Test one tweet counts name ’popular_tweets’ is not defined Testing failed.

Test one tweet counts below name ’popular_tweets’ is not defined Testing failed.

Test one tweet favorites name ’popular_tweets’ is not defined Testing failed.

Test one tweet favorites at cutoff name ’popular_tweets’ is not defined

Testing failed.

Test one tweet favorites below cutoff name ’popular_tweets’ is not defined Testing failed.

Test one tweet replies name ’popular_tweets’ is not defined Testing failed.

Test one tweet replies at cutoff name ’popular_tweets’ is not defined Testing failed.

Test one tweet replies below cutoff name ’popular_tweets’ is not defined Testing failed.

Test one tweet retweets name ’popular_tweets’ is not defined Testing failed.

Test one tweet retweets at cutoff name ’popular_tweets’ is not defined Testing failed.

Test one tweet retweets below cutoff name ’popular_tweets’ is not defined Testing failed.

Test one user counts name ’popular_tweets’ is not defined Testing failed. python: can’t open file ’Project_3_Main.py’: [Errno 2] No such file or directory