Skip to content

Commit

Permalink
#158. Add missing function
Browse files Browse the repository at this point in the history
  • Loading branch information
const8ine committed Sep 10, 2023
1 parent a4cd250 commit 009c706
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/expression_change_human_mrna/replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@
),
)

def get_df_from_db(connection: MySQLConnection, table: str, columns: List) -> DataFrame:
"""Read data from Database from provided table with provided columns"""
columns = ", ".join(columns)
sql = f"SELECT {columns} FROM {table}"
df = pd.read_sql(sql, con=connection)
df = df.dropna()
return df

def get_df_from_csv(file_name: str) -> DataFrame:
"""Read csv file by provided file name"""
cur_dir = os.path.dirname(os.path.abspath(__file__))
Expand Down

0 comments on commit 009c706

Please sign in to comment.