Skip to content

Completed Pandas1#64

Open
kaaviyavarrshini wants to merge 1 commit intosuper30admin:mainfrom
kaaviyavarrshini:main
Open

Completed Pandas1#64
kaaviyavarrshini wants to merge 1 commit intosuper30admin:mainfrom
kaaviyavarrshini:main

Conversation

@kaaviyavarrshini
Copy link

No description provided.

@super30admin
Copy link
Owner

The student's solution demonstrates a good understanding of pandas operations and DataFrame manipulations. Here's a detailed evaluation:

  1. Problem1_2DList.py:

    • Correctness: The solution correctly converts a 2D list to a DataFrame, though using from_dict() with zip is unconventional. The standard approach would be pd.DataFrame(data, columns=columns).
    • Code Quality: The code is readable but could be simplified using the standard DataFrame constructor.
  2. Problem2_BigCountry.py:

    • Correctness: The solution correctly filters countries based on area and population criteria.
    • Efficiency: The filtering operation is efficient with O(n) time complexity where n is the number of rows.
    • Code Quality: Well-structured and concise.
  3. Problem3_Recyclable.py:

    • Correctness: Correctly filters products that are both low-fat and recyclable.
    • Efficiency: The filtering operation is efficient with O(n) time complexity.
    • Code Quality: Clean and straightforward.
  4. Problem4_CustomerNoOrder.py:

    • Correctness: Both solutions correctly identify customers who haven't placed orders.
    • Efficiency:
      • Solution 1 (merge): O(n + m) time complexity where n and m are the sizes of customers and orders.
      • Solution 2 (isin): O(n*m) in worst case, making Solution 1 more efficient for larger datasets.
    • Code Quality:
      • Good to see multiple approaches.
      • The print statement in Solution 1 should be removed as it's not needed for the function's purpose.
      • The column renaming could be done more consistently between solutions.

General improvements:

  • Remove debug print statements in production code.
  • Consider using more descriptive variable names (e.g., 'df' could be more specific).
  • For Problem1, the standard DataFrame constructor would be more straightforward.
  • For Problem4, Solution 1 is more efficient for larger datasets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants