Skip to content

Commit

Permalink
add files
Browse files Browse the repository at this point in the history
  • Loading branch information
amanmdesai committed Jan 10, 2023
1 parent 61d9c5b commit b067302
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
Empty file removed docs/README.md
Empty file.
2 changes: 1 addition & 1 deletion notebooks/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
## How to use notebooks?
## Analysis Notebooks
36 changes: 24 additions & 12 deletions pygrc/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@


class Reader:
"""Reader Class"""
"""Reader Class
"""

def read(
filepath: os.PathLike,
Expand Down Expand Up @@ -37,9 +38,12 @@ def read(
Reading a file
Args:
filepath : path of the file.
columns : list of columns.
units : dict for the units.
filepath : path of the file.
columns : list of columns.
units : dict for the units.
"""
if pathlib.PurePosixPath(filepath).suffix == ".dat":
Expand All @@ -55,13 +59,13 @@ def read(

def drop_columns(data: pd.DataFrame, columns: list):
"""
drop columns from the DataFrame
Drop columns from the DataFrame
Args:
data : pandas dataFrame
data : pandas dataFrame
columns: list of columns to be droped
columns: list of columns to be droped
"""
if len(columns) != 0:
data = data.drop(columns=columns, axis=1)
Expand All @@ -70,10 +74,15 @@ def drop_columns(data: pd.DataFrame, columns: list):
def read_corr(data: pd.DataFrame, row: int, column: int):
"""
read a correlation matrix
Args:
data : pandas dataFrame
row : number of row element
column : number of column element
data : pandas dataFrame.
row : number of row element.
column : number of column element.
"""
return data.iloc[row, column]

Expand All @@ -82,7 +91,8 @@ def correlation(data: pd.DataFrame):
provides correlation matrix for the DataFrame
Args:
data : pandas dataFrame
data : pandas dataFrame
"""
data = data.dropna(axis=1, how="all")
m_corr = data.corr(method="pearson")
Expand All @@ -91,7 +101,9 @@ def correlation(data: pd.DataFrame):
def len(data: pd.DataFrame):
"""
number of rows in the dataframe
Args:
data : pandas dataFrame
data : pandas dataFrame
"""
return len(data)

0 comments on commit b067302

Please sign in to comment.