Finding Proportions with PandasYou have a Twitter dataset (d…

Finding Proportions with PandasYou have a Twitter dataset (df) with columns: user, tweet, when (morning/afternoon/evening), likes, retweet, followers, location.Write one line of Pandas code to find the proportion (not count) of tweets posted in each time period (morning, afternoon, evening) for each user. The output should show proportions (values between 0 and 1) rather than raw counts, with users as rows and time periods as columns.Hint: Use groupby(), value_counts() with a parameter, and unstack().

Writing XPath ExpressionsGiven the following HTML structure:…

Writing XPath ExpressionsGiven the following HTML structure: Product 1 Price: $29.99 Quantity: 100 Product 2 Price: $49.99 Quantity: 50 Answer the following:(a) Write the XPath to select all product elements on the page (used in the for loop). (1 pt)(b) Within a loop iterating over each product row, write the XPath to extract the product title text from the link. (1 pt)(c) Within the same loop, write the XPath to extract the price (first span inside product-info). (1 pt)

Writing SQL from PandasThe following Pandas code calculates…

Writing SQL from PandasThe following Pandas code calculates the average commission for each working area, keeps only areas where the average exceeds 0.14, and sorts from highest to lowest:result = df.groupby(‘working_area’)[‘commission’].mean().reset_index() result.columns = [‘working_area’, ‘avg_commission’] result = result[result[‘avg_commission’] > 0.14] result = result.sort_values(‘avg_commission’, ascending=False)Write the equivalent SQL query that produces the same result. The table name is agents. Your query should use SELECT, FROM, GROUP BY, HAVING, and ORDER BY.