https://github.com/lexx0001/csvmerge
https://github.com/lexx0001/csvmerge
csv csv-merge csv-merge-script
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/lexx0001/csvmerge
- Owner: lexx0001
- Created: 2023-09-14T16:46:23.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-11T17:40:55.000Z (over 2 years ago)
- Last Synced: 2025-02-05T09:54:09.543Z (over 1 year ago)
- Topics: csv, csv-merge, csv-merge-script
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# csvMerge
Documentation for Data Processing Script
========================================
This script is designed to read multiple CSV files from a specified folder, perform
calculations on specific columns, and then merge the resulting data frames into a single
CSV file.
Dependencies:
-------------
- pandas
- glob
Usage:
------
1. Place the CSV files you wish to process in the folder specified in the `csv_files` variable.
2. Run the script.
Modules:
--------
- pandas (as pd)
- glob
Variables:
----------
- csv_files: List of paths to CSV files that need to be processed.
- data_frames: List to store individual processed data frames before merging.
Functions and Loops:
--------------------
1. Loop through each CSV file defined in `csv_files`.
- Read the CSV file into a DataFrame `df`.
- Perform subtraction between columns with indices 2 and 3 to create a new column 'diff'.
- Keep only the 'diff' column and the column with index 5.
- Append this new DataFrame to `data_frames`.
2. Merge all the individual data frames stored in `data_frames` into `merged_df`.
3. Write `merged_df` into a new CSV file without index and header.