DataFrame Operations

  1. Analyzing Baseball Player Data

    Question 1 of 3

    • Read file Baseball_Player_Clean.txt. Perform the following operations: 1. Set name column as index and reset it back. 2. Select age and Position column data using loc and iloc. 3. Select Name, Team, Age of players with age above 30 and weight below 70. 4. Create new column bmi by dividing weight with height squared. 5. Find Name, Age of Players whose name has 8+ characters & starts with "A". 6. Sort players by age in descending and then by weight in ascending order. 7. Drop Column Position Category. 8. Rename Column Name to PlayerName, Team to ClubName. 9. Calculate average age and bmi for each position. 10. Split PlayerName column into FirstName, MiddleName, LastName columns. 11. Find average Height and Weight of U-25 Players. 12. Convert PlayerName to uppercase and Team to lowercase. 13. Save the result as baseball_exercise.csv.
  2. Time Series Analysis of Air Quality Data

    Question 2 of 3

    • Read file air_quality.csv and perform the following operations: 1. Convert date column to datetime and set it as index. 2. Create columns AvgThreeDay, AvgSevenDay with rolling average of AQI Value. 3. Resample data to get monthly average AQI Value. 4. Resample data to get highest AQI Value for each month and city. 5. Find average AQI Value for each month and city combination.
  3. Concat, Merge and GroupBy

    Question 3 of 3

    • Read all transaction files like transaction_n.csv. Combine all of them and save result as transaction.csv.
    • Read transaction.csv and customer.csv. 1. Merge them and save result as customer_txn_info.csv. 2. Find CustomerID, Name, TotalRewardPoint, AverageQuantity. 3. Find total CustomerCount for each City. 4. Find City and TotalDiscount given on each city.