-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add data_script.py to pull desired columns from large data file
- Loading branch information
1 parent
0a08872
commit 8f9b1cc
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import pandas as pd | ||
|
||
# Load the CSV file | ||
file_path = 'pdoCalibrationData_NeuertLab_240925.csv' | ||
data = pd.read_csv(file_path) | ||
|
||
# Filter the data based on Condition = '2M_NaCl_Step' | ||
# Adjusting the filter to be case-insensitive and checking for partial matches | ||
filtered_data = data.loc[data['Condition'].str.contains('2M_NaCl_Step', case=False, na=False), | ||
['Cell_id', 'Condition', 'Replica', 'Conc_mM', 'time', 'RNA_STL1_cyto_TS3Full']] | ||
|
||
# Define the output file path | ||
output_file_path = 'filtered_data_2M_NaCl_Step.csv' | ||
|
||
# Save the filtered data to a new CSV file | ||
filtered_data.to_csv(output_file_path, index=False) | ||
|
||
output_file_path |