filmov
tv
Leetcode MEDIUM 3087 - Find Trending Hashtags REGEX Explained - Solved by Everyday Data Science
Показать описание
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
Комментарии