Replies: 1 comment
-
The problem has been previously reported here, however, I don't see any solution. But the dataset having this problem seems to have a one-day or longer frequency. My dataset with resolution of one hour or 15 min works fine. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I really love this library, I've been trying to use it on a funky dataset, the data summarizes well, but when it comes to report generation it stalls and I get this error:
ValueError Traceback (most recent call last)
File ~\anaconda3\lib\site-packages\IPython\core\formatters.py:344, in BaseFormatter.call(self, obj)
342 method = get_real_method(obj, self.print_method)
343 if method is not None:
--> 344 return method()
345 return None
346 else:
File ~\anaconda3\lib\site-packages\typeguard_init_.py:1033, in typechecked..wrapper(*args, **kwargs)
1031 memo = _CallMemo(python_func, _localns, args=args, kwargs=kwargs)
1032 check_argument_types(memo)
-> 1033 retval = func(*args, **kwargs)
1034 try:
1035 check_return_type(retval, memo)
File ~\anaconda3\lib\site-packages\ydata_profiling\profile_report.py:520, in ProfileReport.repr_html(self)
518 def repr_html(self) -> None:
519 """The ipython notebook widgets user interface gets called by the jupyter notebook."""
--> 520 self.to_notebook_iframe()
File ~\anaconda3\lib\site-packages\typeguard_init_.py:1033, in typechecked..wrapper(*args, **kwargs)
1031 memo = _CallMemo(python_func, _localns, args=args, kwargs=kwargs)
1032 check_argument_types(memo)
-> 1033 retval = func(*args, **kwargs)
1034 try:
1035 check_return_type(retval, memo)
File ~\anaconda3\lib\site-packages\ydata_profiling\profile_report.py:500, in ProfileReport.to_notebook_iframe(self)
498 with warnings.catch_warnings():
499 warnings.simplefilter("ignore")
--> 500 display(get_notebook_iframe(self.config, self))
File ~\anaconda3\lib\site-packages\ydata_profiling\report\presentation\flavours\widget\notebook.py:75, in get_notebook_iframe(config, profile)
73 output = get_notebook_iframe_src(config, profile)
74 elif attribute == IframeAttribute.srcdoc:
---> 75 output = get_notebook_iframe_srcdoc(config, profile)
76 else:
77 raise ValueError(
78 f'Iframe Attribute can be "src" or "srcdoc" (current: {attribute}).'
79 )
File ~\anaconda3\lib\site-packages\ydata_profiling\report\presentation\flavours\widget\notebook.py:29, in get_notebook_iframe_srcdoc(config, profile)
27 width = config.notebook.iframe.width
28 height = config.notebook.iframe.height
---> 29 src = html.escape(profile.to_html())
31 iframe = f'<iframe width="{width}" height="{height}" srcdoc="{src}" frameborder="0" allowfullscreen></iframe>'
33 return HTML(iframe)
File ~\anaconda3\lib\site-packages\typeguard_init_.py:1033, in typechecked..wrapper(*args, **kwargs)
1031 memo = _CallMemo(python_func, _localns, args=args, kwargs=kwargs)
1032 check_argument_types(memo)
-> 1033 retval = func(*args, **kwargs)
1034 try:
1035 check_return_type(retval, memo)
File ~\anaconda3\lib\site-packages\ydata_profiling\profile_report.py:470, in ProfileReport.to_html(self)
462 def to_html(self) -> str:
463 """Generate and return complete template as lengthy string
464 for using with frameworks.
465
(...)
468
469 """
--> 470 return self.html
File ~\anaconda3\lib\site-packages\typeguard_init_.py:1033, in typechecked..wrapper(*args, **kwargs)
1031 memo = _CallMemo(python_func, _localns, args=args, kwargs=kwargs)
1032 check_argument_types(memo)
-> 1033 retval = func(*args, **kwargs)
1034 try:
1035 check_return_type(retval, memo)
File ~\anaconda3\lib\site-packages\ydata_profiling\profile_report.py:277, in ProfileReport.html(self)
274 @Property
275 def html(self) -> str:
276 if self._html is None:
--> 277 self._html = self._render_html()
278 return self._html
File ~\anaconda3\lib\site-packages\typeguard_init_.py:1033, in typechecked..wrapper(*args, **kwargs)
1031 memo = _CallMemo(python_func, _localns, args=args, kwargs=kwargs)
1032 check_argument_types(memo)
-> 1033 retval = func(*args, **kwargs)
1034 try:
1035 check_return_type(retval, memo)
File ~\anaconda3\lib\site-packages\ydata_profiling\profile_report.py:385, in ProfileReport._render_html(self)
382 def _render_html(self) -> str:
383 from ydata_profiling.report.presentation.flavours import HTMLReport
--> 385 report = self.report
387 with tqdm(
388 total=1, desc="Render HTML", disable=not self.config.progress_bar
389 ) as pbar:
390 html = HTMLReport(copy.deepcopy(report)).render(
391 nav=self.config.html.navbar_show,
392 offline=self.config.html.use_local_assets,
(...)
400 version=self.description_set.package["ydata_profiling_version"],
401 )
File ~\anaconda3\lib\site-packages\typeguard_init_.py:1033, in typechecked..wrapper(*args, **kwargs)
1031 memo = _CallMemo(python_func, _localns, args=args, kwargs=kwargs)
1032 check_argument_types(memo)
-> 1033 retval = func(*args, **kwargs)
1034 try:
1035 check_return_type(retval, memo)
File ~\anaconda3\lib\site-packages\ydata_profiling\profile_report.py:271, in ProfileReport.report(self)
268 @Property
269 def report(self) -> Root:
270 if self._report is None:
--> 271 self._report = get_report_structure(self.config, self.description_set)
272 return self._report
File ~\anaconda3\lib\site-packages\ydata_profiling\report\structure\report.py:387, in get_report_structure(config, summary)
368 section_items: List[Renderable] = [
369 Container(
370 get_dataset_items(config, summary, alerts),
(...)
374 ),
375 ]
377 if len(summary.variables) > 0:
378 section_items.append(
379 Dropdown(
380 name="Variables",
381 anchor_id="variables-dropdown",
382 id="variables-dropdown",
383 is_row=True,
384 classes=["dropdown-toggle"],
385 items=list(summary.variables),
386 item=Container(
--> 387 render_variables_section(config, summary),
388 sequence_type="accordion",
389 name="Variables",
390 anchor_id="variables",
391 ),
392 )
393 )
395 scatter_items = get_interactions(config, summary.scatter)
396 if len(scatter_items) > 0:
File ~\anaconda3\lib\site-packages\ydata_profiling\report\structure\report.py:162, in render_variables_section(config, dataframe_summary)
160 variable_type = summary["type"]
161 render_map_type = render_map.get(variable_type, render_map["Unsupported"])
--> 162 template_variables.update(render_map_type(config, template_variables))
164 # Ignore these
165 if reject_variables:
File ~\anaconda3\lib\site-packages\ydata_profiling\report\structure\variables\render_timeseries.py:356, in render_timeseries(config, summary)
339 acf_pacf = Image(
340 plot_acf_pacf(config, summary["series"]),
341 image_format=image_format,
(...)
345 anchor_id=f"{varid}acf_pacf",
346 )
348 ts_plot = Image(
349 mini_ts_plot(config, summary["series"], figsize=(7, 3)),
350 image_format=image_format,
(...)
353 anchor_id=f"{varid}_ts_plot",
354 )
--> 356 ts_gap = _render_gap_tab(config, summary)
358 template_variables["bottom"] = Container(
359 [statistics, hist, ts_plot, ts_gap, fq, evs, acf_pacf],
360 sequence_type="tabs",
361 anchor_id=f"{varid}bottom",
362 )
364 return template_variables
File ~\anaconda3\lib\site-packages\ydata_profiling\report\structure\variables\render_timeseries.py:36, in _render_gap_tab(config, summary)
26 def _render_gap_tab(config: Settings, summary: dict) -> Container:
27 gap_stats = [
28 {
29 "name": "number of gaps",
30 "value": fmt_numeric(
31 len(summary["gap_stats"]["gaps"]), precision=config.report.precision
32 ),
33 },
34 {
35 "name": "min",
---> 36 "value": fmt_timespan_timedelta(
37 summary["gap_stats"]["min"], precision=config.report.precision
38 ),
39 },
40 {
41 "name": "max",
42 "value": fmt_timespan_timedelta(
43 summary["gap_stats"]["max"], precision=config.report.precision
44 ),
45 },
46 {
47 "name": "mean",
48 "value": fmt_timespan_timedelta(
49 summary["gap_stats"]["mean"], precision=config.report.precision
50 ),
51 },
52 {
53 "name": "std",
54 "value": fmt_timespan_timedelta(
55 summary["gap_stats"]["std"], precision=config.report.precision
56 ),
57 },
58 ]
60 gap_table = Table(
61 gap_stats,
62 name="Gap statistics",
63 style=config.html.style,
64 )
66 gap_plot = Image(
67 plot_timeseries_gap_analysis(
68 config, summary["gap_stats"]["series"], summary["gap_stats"]["gaps"]
(...)
73 anchor_id=f"{summary['varid']}_gap_plot",
74 )
File ~\anaconda3\lib\site-packages\ydata_profiling\report\formatters.py:233, in fmt_timespan_timedelta(delta, detailed, max_units, precision)
231 return fmt_timespan(num_seconds, detailed, max_units)
232 else:
--> 233 return fmt_numeric(delta, precision)
File ~\anaconda3\lib\site-packages\ydata_profiling\report\formatters.py:27, in list_args..inner(arg, *args, **kwargs)
24 if isinstance(arg, list):
25 return [func(v, *args, **kwargs) for v in arg]
---> 27 return func(arg, *args, **kwargs)
File ~\anaconda3\lib\site-packages\ydata_profiling\report\formatters.py:247, in fmt_numeric(value, precision)
236 @list_args
237 def fmt_numeric(value: float, precision: int = 10) -> str:
238 """Format any numeric value.
239
240 Args:
(...)
245 The numeric value with the given precision.
246 """
--> 247 fmtted = f"{{:.{precision}g}}".format(value)
248 for v in ["e+", "e-"]:
249 if v in fmtted:
File ~\anaconda3\lib\site-packages\pandas_libs\tslibs\nattype.pyx:59, in pandas._libs.tslibs.nattype._make_error_func.f()
ValueError: NaTType does not support strftime
I checked the dataset and there are no NAAT, and all the data checks out, any idea why?
Beta Was this translation helpful? Give feedback.
All reactions