Skip to content

Pandas 1 Completed#68

Open
alokusw2 wants to merge 5 commits intosuper30admin:mainfrom
alokusw2:main
Open

Pandas 1 Completed#68
alokusw2 wants to merge 5 commits intosuper30admin:mainfrom
alokusw2:main

Conversation

@alokusw2
Copy link

@alokusw2 alokusw2 commented Jul 9, 2025

No description provided.

alokusw2 added 5 commits July 2, 2025 15:07
git push -u origin main
git push -u origin main
git push -u origin main
git push -u origin main
git push -u origin main
git push -u origin main
git push -u origin main
git push -u origin main
git push -u origin main
git push -u origin main
git push -u origin main
Merge branch 'main' of https://github.com/alokusw2/Pandas1
git pull origin main --allow-unrelated-histories
@super30admin
Copy link
Owner

The student's solution demonstrates a good understanding of creating Pandas DataFrames from 2D lists and solving basic DataFrame filtering problems. Here are some specific observations:

Strengths:

  1. The solution covers multiple methods for creating DataFrames (pd.DataFrame, from_records, from_dict) which shows comprehensive knowledge.
  2. The filtering logic for the LeetCode problems (Big Countries, Recyclable Products, Customers Who Never Order) is correct and efficient.
  3. The code is generally readable with appropriate comments and structure.

Areas for Improvement:

  1. There's a typo in the first example: pd.Dataframe should be pd.DataFrame (capital F) and there's a missing quote in columns=['Tag', 'number].
  2. The solution could benefit from more explanation of why certain approaches are used (e.g., why merge with how='left' for the customer orders problem).
  3. For the customer orders problem, it might be more memory efficient to use ~customers['id'].isin(orders['customerId']) instead of a merge operation.
  4. Some examples could include edge case handling (e.g., empty DataFrames or None values).
  5. The solution could be better organized with clear separation between different problems/examples.

Time Complexity:

  1. The DataFrame creation operations are O(n) where n is the number of elements.
  2. The filtering operations are O(n) for scanning through the DataFrame.
  3. The merge operation is O(n*m) in worst case, but could be optimized as mentioned above.

Space Complexity:

  1. All operations create new DataFrames, so space complexity is O(n) for the new DataFrames.
  2. The merge operation creates a potentially large intermediate DataFrame.

Code Quality:

  1. Generally good, but could be improved with consistent formatting (some examples have extra whitespace).
  2. Variable names are clear and appropriate.
  3. Missing docstrings for the functions would be helpful.

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.

2 participants