Watch and track your favorite playlist.
Curated by: Everyday Data Science (140 videos)
Question: https://leetcode.com/problems/find-trending-hashtags/description/ Regex NTU article: https://www3.ntu.edu.sg/home/ehchua/programming/howto/Regexe.html SQL Schema: Create table If Not Exists Tweets (user_id int, tweet_id int, tweet_date date, tweet varchar(100)) Truncate table Tweets insert into Tweets (user_id, tweet_id, tweet, tweet_date) values ('135', '13', 'Enjoying a great start to the day. #HappyDay', '2024-02-01') insert into Tweets (user_id, tweet_id, tweet, tweet_date) values ('136', '14', 'Another #HappyDay with good ', '2024-02-03') insert into Tweets (user_id, tweet_id, tweet, tweet_date) values ('137', '15', 'Productivity peaks! #WorkLife', '2024-02-04') insert into Tweets (user_id, tweet_id, tweet, tweet_date) values ('138', '16', 'Exploring new tech frontiers. #TechLife', '2024-02-04') insert into Tweets (user_id, tweet_id, tweet, tweet_date) values ('139', '17', 'Gratitude for today's moments. #HappyDay', '2024-02-05') insert into Tweets (user_id, tweet_id, tweet, tweet_date) values ('140', '18', 'Innovation drives us. #TechLife', '2024-02-07') insert into Tweets (user_id, tweet_id, tweet, tweet_date) values ('141', '19', 'Connecting with nature's serenity. #Nature', '2024-02-09') Pandas Schema: data = [[135, 13, 'Enjoying a great start to the day. #HappyDay', '2024-02-01'], [136, 14, 'Another #HappyDay with good ', '2024-02-03'], [137, 15, 'Productivity peaks! #WorkLife', '2024-02-04'], [138, 16, 'Exploring new tech frontiers. #TechLife', '2024-02-04'], [139, 17, "Gratitude for today's moments. #HappyDay", '2024-02-05'], [140, 18, 'Innovation drives us. #TechLife', '2024-02-07'], [141, 19, "Connecting with nature's serenity. #Nature", '2024-02-09']] tweets = pd.DataFrame(data, columns=['user_id', 'tweet_id', 'tweet_date', 'tweet']).astype({'user_id':'Int64', 'tweet_id':'Int64', 'tweet_date':'datetime64[ns]', 'tweet':'object'}) #datascience #mysqltutorials #leetcodesolutions