Refactoring for More Pythonic Code
This commit is contained in:
@@ -21,15 +21,14 @@ import pandas as pd
|
||||
import numpy as np
|
||||
import csv
|
||||
|
||||
|
||||
def numpy(array: np.ndarray, path: str) -> np.ndarray:
|
||||
|
||||
with open(path, mode='w') as sistema_linear:
|
||||
|
||||
solution_writer = csv.writer(sistema_linear, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
|
||||
with open(path, mode='w') as linear_system:
|
||||
solution_writer = csv.writer(linear_system, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
|
||||
solution_writer.writerows(array)
|
||||
|
||||
|
||||
return array
|
||||
|
||||
def pandas(df: pd.DataFrame, path:str) -> None:
|
||||
|
||||
df.to_csv(path)
|
||||
|
||||
def pandas(df: pd.DataFrame, path: str) -> None:
|
||||
df.to_csv(path)
|
||||
|
||||
Reference in New Issue
Block a user