bhargavnova / python-helper-modules

MIT License
7 stars 24 forks source link

CSV Data Filter Function/Module #46

Closed bhargavnova closed 9 months ago

bhargavnova commented 9 months ago

Objective

Develop a Python module that provides a function for filtering data in CSV (Comma Separated Values) files based on user-defined criteria. This module will enable users to specify conditions like column name, filter value, and comparison operators (e.g., equals, not equals) to selectively extract data from CSV files.

Features

Example Usage

import csv_filter

# Filter data where 'Age' is greater than 30
filtered_data = csv_filter.filter_csv('data.csv', column='Age', operator='>', value=30)

# Filter data where 'Status' is 'Active'
filtered_data = csv_filter.filter_csv('data.csv', column='Status', operator='==', value='Active')

# Save the filtered data to a new CSV file
csv_filter.save_filtered_data('filtered_data.csv', filtered_data)

Difficulty: Beginner/Intermediate

Tags: Python, CSV, Data Filtering, Data Manipulation

Additional Information

Contribution Guidelines

The updated guidelines can be found here.

Note:

kom-senapati commented 9 months ago

I want to work on this. Please assign me this issue.

bhargavnova commented 9 months ago

Sure @kom-senapati , Thanks for picking this up!

Happy Coding!