DataFrame Operations
✕Analyzing Baseball Player Data
Question 1 of 3
- Read file
Baseball_Player_Clean.txt. Perform the following operations: 1. Setnamecolumn as index and reset it back. 2. SelectageandPositioncolumn data using loc and iloc. 3. SelectName,Team,Ageof players with age above 30 and weight below 70. 4. Create new columnbmiby dividing weight with height squared. 5. FindName,Ageof Players whose name has8+characters & starts with "A". 6. Sort players by age in descending and then by weight in ascending order. 7. Drop ColumnPosition Category. 8. Rename ColumnNametoPlayerName,TeamtoClubName. 9. Calculate average age and bmi for each position. 10. SplitPlayerNamecolumn intoFirstName,MiddleName,LastNamecolumns. 11. Find averageHeightandWeightof U-25 Players. 12. ConvertPlayerNameto uppercase andTeamto lowercase. 13. Save the result asbaseball_exercise.csv.
- Read file
Time Series Analysis of Air Quality Data
Question 2 of 3
- Read file
air_quality.csvand perform the following operations: 1. Convertdatecolumn to datetime and set it as index. 2. Create columnsAvgThreeDay,AvgSevenDaywith rolling average ofAQI Value. 3. Resample data to get monthly averageAQI Value. 4. Resample data to get highestAQI Valuefor each month and city. 5. Find averageAQI Valuefor each month and city combination.
- Read file
Concat, Merge and GroupBy
Question 3 of 3
- Read all transaction files like
transaction_n.csv. Combine all of them and save result astransaction.csv. - Read
transaction.csvandcustomer.csv. 1. Merge them and save result ascustomer_txn_info.csv. 2. FindCustomerID,Name,TotalRewardPoint,AverageQuantity. 3. Find totalCustomerCountfor eachCity. 4. FindCityandTotalDiscountgiven on each city.
- Read all transaction files like
