<jupyter_start><jupyter_text>Read user tweets about a company "Fudgemart" display a chart showing who tweeted the mostallow the user to select a someone to view tweetsfor a better grade I might do sentiment analysis over the tweets to classify users as positive or negative tweeters aboutr the company. or I could do something else, but I need to demonstrate I can use something not shown in the class already.<jupyter_code>import plotly.express as px
import pandas as pd
from IPython.display import display


def draw_chart(user_counts):
    display(px.bar(user_counts, x='user', y='count', title="Tweet Counts By User Name"))    

url="https://raw.githubusercontent.com/mafudge/datasets/master/tweets/tweets.json"
tweets = pd.read_json(url)
user_counts = pd.DataFrame({ "user": tweets['user'].value_counts().index, "count" : tweets['user'].value_counts()})
draw_chart(user_counts)
while True:
    user = input("Enter the user name to see their tweets, type chart or quit: ").lower()
    if user == 'quit':
        print("The program is over!!!")
        break
    elif user =='chart':
        draw_chart(user_counts)
    elif user in tweets['user'].values:
        user_tweets = tweets[ tweets['user'] == user][['created_at','text']].sort_values('created_at')
        #display(user_tweets)
        print("TWEETS for", user)
        for row in user_tweets.to_records():
            print(f"{row['created_at']} {row['text']}")
    else:
        print(f"{user} is not in the list of users!")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11842105263157894, 'fraction_numerical': 0.0, 'mean_word_length': 4.22680412371134, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '599675', 'license': 'MIT', 'n_tokens_mistral': 480, 'n_tokens_neox': 465, 'n_words': 153, 'path': 'ist256-in-class-examples/lesson13/Sample Project.ipynb', 'repo_name': 'IST256-classroom/2019-fall-learn-python-mafudge', 'size': '1520'}