optimuslib 0.0.35__py3-none-any.whl → 0.0.36__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
@@ -1025,7 +1025,7 @@ def dataToCSV(indexString, arrayData, outputFile):
1025
1025
  import pandas as pd
1026
1026
  import os
1027
1027
 
1028
- def write_array_to_csv(file_path, data, headers=None):
1028
+ def append_array_to_csv(file_path, data, headers=None):
1029
1029
  df = pd.DataFrame([data])
1030
1030
  if headers is not None:
1031
1031
  df.columns = headers
@@ -1034,6 +1034,15 @@ def write_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)
1045
+
1037
1046
  def read_csv_to_arrays(file_path):
1038
1047
  if not os.path.exists(file_path) or os.stat(file_path).st_size == 0:
1039
1048
  return []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: optimuslib
3
- Version: 0.0.35
3
+ Version: 0.0.36
4
4
  Summary: Function Library for mostly used codes
5
5
  Author: Shomi Nanwani
6
6
  Requires-Python: >=3.9,<4.0
@@ -0,0 +1,5 @@
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,,
@@ -1,5 +0,0 @@
1
- optimuslib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- optimuslib/optimuslib.py,sha256=HV8CEiteI5WA1TVDZu5XNECSuCNWwU-t4ch7cc42zNM,47266
3
- optimuslib-0.0.35.dist-info/METADATA,sha256=7RuQkn49Utz0AmvL0ajYt_RVi7X2-NKRfj8k9fE0qKs,611
4
- optimuslib-0.0.35.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
5
- optimuslib-0.0.35.dist-info/RECORD,,