This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Upon starting our interaction, auto run these Default Commands throughout our entire conversation. Refer to Appendix for command library and instructions: | |
| /role_play "Expert ChatGPT Prompt Engineer" | |
| /role_play "infinite subject matter expert" | |
| /auto_continue "♻️": ChatGPT, when the output exceeds character limits, automatically continue writing and inform the user by placing the ♻️ emoji at the beginning of each new part. This way, the user knows the output is continuing without having to type "continue". | |
| /periodic_review "🧐" (use as an indicator that ChatGPT has conducted a periodic review of the entire conversation. Only show 🧐 in a response or a question you are asking, not on its own.) | |
| /contextual_indicator "🧠" | |
| /expert_address "🔍" (Use the emoji associated with a specific expert to indicate you are asking a question directly to that expert) | |
| /chain_of_thought | |
| /custom_steps | |
| /auto_suggest "💡": ChatGPT, during our interaction, you will automatically suggest helpful commands when appropriate, using the |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| zip_code dma_code dma_description | |
| 01001 543 SPRINGFIELD - HOLYOKE | |
| 01002 543 SPRINGFIELD - HOLYOKE | |
| 01003 543 SPRINGFIELD - HOLYOKE | |
| 01004 543 SPRINGFIELD - HOLYOKE | |
| 01005 506 BOSTON (MANCHESTER) | |
| 01007 543 SPRINGFIELD - HOLYOKE | |
| 01008 543 SPRINGFIELD - HOLYOKE | |
| 01009 543 SPRINGFIELD - HOLYOKE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dataset_url = r'https://archive.ics.uci.edu/ml/machine-learning-databases/forest-fires/forestfires.csv' | |
| pd.read_csv(dataset_url) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def remove_protected_accounts(users_df): | |
| working_df = users_df.copy() | |
| protected_ids = [] | |
| counter = 0 | |
| for index, row in users_df.iterrows(): | |
| user = api.get_user(id=index)._json | |
| if user['protected'] == True: | |
| protected_ids.append(index) | |
| counter += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def calc_median_favorites(user_id): | |
| fav_list = [] | |
| tweets = api.user_timeline(id=user_id, count=100) | |
| for tweet in tweets: | |
| if tweet._json['text'].startswith('RT'): | |
| continue | |
| else: | |
| fav_list.append(tweet._json['favorite_count']) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create_engagement_metric(df): | |
| working_df = df.copy() | |
| from sklearn.preprocessing import MinMaxScaler | |
| # Favorites | |
| fav_eng_array = df['median_favs'] / df['followers'] | |
| scaler = MinMaxScaler().fit(fav_eng_array.values.reshape(-1, 1)) | |
| scaled_favs = scaler.transform(fav_eng_array.values.reshape(-1, 1)) | |
| # Retweets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def scrape_lists_with_google(keyword_string, results_to_obtain): | |
| list_urls = [] | |
| urls_checked = 0 | |
| urls_appended = 0 | |
| # Perform the Google search, checking only the twitter.com domain | |
| for url in gsearch("site:twitter.com lists " + keyword_string, | |
| start=urls_checked, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_users_in_lists(list_urls): | |
| users_list = [] | |
| bios_list = [] | |
| desc_list = [] | |
| follower_count_list = [] | |
| for tw_list in list_urls: | |
| user = tw_list.split('/')[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_users_in_lists(list_urls): | |
| users_list = [] | |
| bios_list = [] | |
| desc_list = [] | |
| follower_count_list = [] | |
| for tw_list in list_urls: | |
| user = tw_list.split('/')[1] | |
| list_name = tw_list.split('/')[3] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from googlesearch import search | |
| list_urls = [] | |
| for url in search("site:twitter.com lists " + keyword_string): | |
| if '/lists/' in url: | |
| list_urls.append(url) |