-
Notifications
You must be signed in to change notification settings - Fork 455
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
Error for train_elec.plot() whcih is :DatetimeArray._generate_range() got an unexpected keyword argument 'closed' #973
Comments
Thank you for the confirmation. I wanted to see if I could get the same results as the plot results posted on github, so I tried using the fill method(ffill) and saw that the results were different. When determining the state in the github code, 2000 samples larger than the threshold value are randomly selected, so the rmse results may come out slightly different, but my rmse results differ so greatly that it is strange. If you find a code that gives the same results as those posted on GitHub, please let me know. |
@hamidreza2122 how did you solve the first error? |
I am working on disaggregation_and_metrics and there is an error for train_elec.plot() whcih is :DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
The details of error is:
TypeError Traceback (most recent call last)
Cell In[24], line 1
----> 1 train_elec.plot()
File c:\users\rezaeiha\nilmtk\nilmtk\metergroup.py:1416, in MeterGroup.plot(self, kind, **kwargs)
1408 function_map = {
1409 'separate lines': self._plot_separate_lines,
1410 'sum': super(MeterGroup, self).plot,
(...)
1413 'energy bar': self._plot_energy_bar
1414 }
1415 try:
-> 1416 ax = function_mapkind
1417 except KeyError:
1418 raise ValueError("'{}' not a valid setting for 'kind' parameter."
1419 .format(kind))
File c:\users\rezaeiha\nilmtk\nilmtk\metergroup.py:1425, in MeterGroup._plot_separate_lines(self, ax, plot_legend, **kwargs)
1423 for meter in self.meters:
1424 if isinstance(meter, MeterGroup):
-> 1425 ax = meter.plot(ax=ax, plot_legend=False, kind='sum', **kwargs)
1426 else:
1427 ax = meter.plot(ax=ax, plot_legend=False, **kwargs)
File c:\users\rezaeiha\nilmtk\nilmtk\metergroup.py:1416, in MeterGroup.plot(self, kind, **kwargs)
1408 function_map = {
1409 'separate lines': self._plot_separate_lines,
1410 'sum': super(MeterGroup, self).plot,
(...)
1413 'energy bar': self._plot_energy_bar
1414 }
1415 try:
-> 1416 ax = function_mapkind
1417 except KeyError:
1418 raise ValueError("'{}' not a valid setting for 'kind' parameter."
1419 .format(kind))
File c:\users\rezaeiha\nilmtk\nilmtk\electric.py:179, in Electric.plot(self, ax, timeframe, plot_legend, unit, plot_kwargs, **kwargs)
177 kwargs['sections'] = [timeframe]
178 kwargs = self._set_sample_period(timeframe, **kwargs)
--> 179 power_series = self.power_series_all_data(**kwargs)
180 if power_series is None or power_series.empty:
181 return ax
File c:\users\rezaeiha\nilmtk\nilmtk\electric.py:105, in Electric.power_series_all_data(self, **kwargs)
103 def power_series_all_data(self, **kwargs):
104 chunks = []
--> 105 for series in self.power_series(**kwargs):
106 if len(series) > 0:
107 chunks.append(series)
File c:\users\rezaeiha\nilmtk\nilmtk\electric.py:626, in Electric.load_series(self, **kwargs)
624 physical_quantity = kwargs['physical_quantity']
625 generator = self.load(**kwargs)
--> 626 for chunk in generator:
627 if chunk.empty:
628 yield chunk
File c:\users\rezaeiha\nilmtk\nilmtk\metergroup.py:720, in MeterGroup.load(self, **kwargs)
718 start = normalise_timestamp(section.start, freq)
719 tz = None if start.tz is None else start.tz.zone
--> 720 index = pd.date_range(
721 start.tz_localize(None), section.end.tz_localize(None), tz=tz,
722 closed='left', freq=freq)
723 chunk = combine_chunks_from_generators(
724 index, columns, self.meters, kwargs)
725 yield chunk
File ~\AppData\Local\anaconda3\Lib\site-packages\pandas\core\indexes\datetimes.py:1009, in date_range(start, end, periods, freq, tz, normalize, name, inclusive, unit, **kwargs)
1006 if freq is None and com.any_none(periods, start, end):
1007 freq = "D"
-> 1009 dtarr = DatetimeArray._generate_range(
1010 start=start,
1011 end=end,
1012 periods=periods,
1013 freq=freq,
1014 tz=tz,
1015 normalize=normalize,
1016 inclusive=inclusive,
1017 unit=unit,
1018 **kwargs,
1019 )
1020 return DatetimeIndex._simple_new(dtarr, name=name)
TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
The text was updated successfully, but these errors were encountered: