-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e6d0b8c
commit c5278f7
Showing
4 changed files
with
233 additions
and
5 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
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
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
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,35 @@ | ||
import pandas as pd | ||
|
||
# Defining function to get depth ranges | ||
def get_depth_ranges(df: pd.DataFrame) -> pd.DataFrame: | ||
|
||
# Creating empty lists | ||
column_name_list = [] | ||
min_depth_list = [] | ||
max_depth_list = [] | ||
|
||
for i in range(len(df.columns)): | ||
# Getting column name | ||
column_name = df.columns[i] | ||
|
||
# Selecting Data | ||
data = df[[df.columns[i]] + ['DEPTH']].dropna() | ||
|
||
# Getting minimum depth of log | ||
min_depth = min(data.loc[:, ~data.columns.duplicated()].copy()['DEPTH']) | ||
|
||
# Getting maximum depth of log | ||
max_depth = max(data.loc[:, ~data.columns.duplicated()].copy()['DEPTH']) | ||
|
||
# Appending values to list | ||
column_name_list.append(column_name) | ||
min_depth_list.append(min_depth) | ||
max_depth_list.append(max_depth) | ||
|
||
data_dict = {'mnemonic': column_name_list, | ||
'Depth Min': min_depth_list, | ||
'Depth Max': max_depth_list} | ||
|
||
data_df = pd.DataFrame.from_dict(data=data_dict, orient='columns')#, columns=['original_mnemonic', 'Depth Min', 'Depth Max']) | ||
|
||
return data_df |