Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formatter gets series instead of float value #105

Open
dz0 opened this issue Jan 18, 2022 · 4 comments
Open

formatter gets series instead of float value #105

dz0 opened this issue Jan 18, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@dz0
Copy link

dz0 commented Jan 18, 2022

hi when using

  File "/home/jurgis/PycharmProjects/debitum-portfolio/notebooks/jurgis/sw_report.py", line 22, in <module>
    my_report = sv.compare([df_A, "A"], [df_B, "B"])
  File "/home/jurgis/anaconda3/envs/debitum-portfolio/lib/python3.8/site-packages/sweetviz/sv_public.py", line 22, in compare
    report = sweetviz.DataframeReport(source, target_feat, compare,
  File "/home/jurgis/anaconda3/envs/debitum-portfolio/lib/python3.8/site-packages/sweetviz/dataframe_report.py", line 256, in __init__
    self._features[f.source.name] = sa.analyze_feature_to_dictionary(f)
  File "/home/jurgis/anaconda3/envs/debitum-portfolio/lib/python3.8/site-packages/sweetviz/series_analyzer.py", line 142, in analyze_feature_to_dictionary
    sweetviz.series_analyzer_text.analyze(to_process, returned_feature_dict)
  File "/home/jurgis/anaconda3/envs/debitum-portfolio/lib/python3.8/site-packages/sweetviz/series_analyzer_text.py", line 50, in analyze
    feature_dict["html_summary"] = sv_html.generate_html_summary_text(feature_dict, compare_dict)
  File "/home/jurgis/anaconda3/envs/debitum-portfolio/lib/python3.8/site-packages/sweetviz/sv_html.py", line 226, in generate_html_summary_text
    output = template.render(feature_dict = feature_dict, compare_dict = compare_dict, \
  File "/home/jurgis/anaconda3/envs/debitum-portfolio/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/home/jurgis/anaconda3/envs/debitum-portfolio/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/home/jurgis/anaconda3/envs/debitum-portfolio/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "/home/jurgis/anaconda3/envs/debitum-portfolio/lib/python3.8/site-packages/sweetviz/templates/feature_summary_text.html", line 25, in top-level template code
    <div class="pair-pos__num dim">{{ rowdata.count_compare.number|fmt_int_limit }}</div>
  File "/home/jurgis/anaconda3/envs/debitum-portfolio/lib/python3.8/site-packages/sweetviz/sv_html_formatters.py", line 16, in fmt_int_limit
    if value > 999999:
  File "/home/jurgis/anaconda3/envs/debitum-portfolio/lib/python3.8/site-packages/pandas/core/generic.py", line 1442, in __nonzero__
    raise ValueError(
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

with debug I see, that fmt_int_limit gets series with single row: datetime in index, and integer in value.

@fbdesignpro
Copy link
Owner

Apologies for the long delay, is anyone else seeing this? I'd like to update with a fix, but it would be easier with a good test case.

@fbdesignpro fbdesignpro added the bug Something isn't working label Nov 16, 2023
@fbdesignpro
Copy link
Owner

@dz0 I'm not sure if you remember this ;)

@IKosovych
Copy link

@fbdesignpro I have this error

@fbdesignpro
Copy link
Owner

@IKosovych Thank you; I'll dig deeper. Can you give me any details? Ideally if you have a test case that'd the great but if you could tell me anything about the function being called and the data that would be helpful also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants