optimuslib 0.0.36__py3-none-any.whl → 0.0.37__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
optimuslib/optimuslib.py
CHANGED
|
@@ -1034,14 +1034,18 @@ def append_array_to_csv(file_path, data, headers=None):
|
|
|
1034
1034
|
else:
|
|
1035
1035
|
df.to_csv(file_path, mode='a', index=False, header=False)
|
|
1036
1036
|
|
|
1037
|
+
# def write_array_to_csv(file_path, data, headers=None):
|
|
1038
|
+
# df = pd.DataFrame([data])
|
|
1039
|
+
# if headers is not None:
|
|
1040
|
+
# df.columns = headers
|
|
1041
|
+
# if not os.path.exists(file_path) or os.stat(file_path).st_size == 0:
|
|
1042
|
+
# df.to_csv(file_path, mode='w', index=False, header=headers is not None)
|
|
1043
|
+
# else:
|
|
1044
|
+
# df.to_csv(file_path, mode='w', index=False, header=False)
|
|
1037
1045
|
def write_array_to_csv(file_path, data, headers=None):
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
if not os.path.exists(file_path) or os.stat(file_path).st_size == 0:
|
|
1042
|
-
df.to_csv(file_path, mode='w', index=False, header=headers is not None)
|
|
1043
|
-
else:
|
|
1044
|
-
df.to_csv(file_path, mode='w', index=False, header=False)
|
|
1046
|
+
with open(file_path, 'w', newline='') as file:
|
|
1047
|
+
writer = csv.writer(file)
|
|
1048
|
+
writer.writerows(data)
|
|
1045
1049
|
|
|
1046
1050
|
def read_csv_to_arrays(file_path):
|
|
1047
1051
|
if not os.path.exists(file_path) or os.stat(file_path).st_size == 0:
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
optimuslib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
optimuslib/optimuslib.py,sha256=9oRXJ9SqKqHlCuo_9BIYTrPUQ1fmc7ObUObzJ7oweVM,47839
|
|
3
|
+
optimuslib-0.0.37.dist-info/METADATA,sha256=XjNdnYl_Z6Whpjj7tQDmizOG2Iu46pqE5MD2DrpatwE,611
|
|
4
|
+
optimuslib-0.0.37.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
5
|
+
optimuslib-0.0.37.dist-info/RECORD,,
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
optimuslib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
optimuslib/optimuslib.py,sha256=fP1yzOWFJueTIh5ejyaN4dmkAvmsa3_wMt0kqc6KNCc,47648
|
|
3
|
-
optimuslib-0.0.36.dist-info/METADATA,sha256=5VNcACqwVtvnQu6WrTlUrEiONUHBUKsD-chiawgK2QU,611
|
|
4
|
-
optimuslib-0.0.36.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
5
|
-
optimuslib-0.0.36.dist-info/RECORD,,
|
|
File without changes
|