Skip to content

Commit

Permalink
Fix datetime issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fealho committed Oct 18, 2023
1 parent bc92a5e commit 01000e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdmetrics/single_table/new_row_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def compute_breakdown(cls, real_data, synthetic_data, metadata=None,

for field, field_meta in get_columns_from_metadata(metadata).items():
if get_type_from_column_meta(field_meta) == 'datetime':
if len(real_data[field]) > 0 and isinstance(real_data[field][0], str):
real_data[field] = pd.to_datetime(real_data[field])
synthetic_data[field] = pd.to_datetime(synthetic_data[field])

real_data[field] = pd.to_numeric(real_data[field])
synthetic_data[field] = pd.to_numeric(synthetic_data[field])

Expand Down

0 comments on commit 01000e6

Please sign in to comment.