53823a31d05f187df7967b7208ce97f584964551,nilmtk/electric.py,Electric,activity_distribution,#Electric#Any#Any#,570
Before Change
on_chunk = on_chunk.resample(bin_duration, how="max")
// reindex so it starts and ends at midnight
start = on_chunk.index[0].date()
end = on_chunk.index[-1].date() + timedelta(days=1)
new_index = pd.date_range(start, end, freq=bin_duration, closed="left")
on_chunk = on_chunk.reindex(new_index)
on_chunk = on_chunk.fillna(0)
After Change
// Trick using resample to "normalise" start and end dates
// to natural boundaries of "period".
resampled_to_period = on_chunk.iloc[[0, -1]].resample(period).index
start = resampled_to_period[0]
end = resampled_to_period[-1] + 1
// Reindex chunk
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: nilmtk/nilmtk
Commit Name: 53823a31d05f187df7967b7208ce97f584964551
Time: 2014-12-20
Author: jack-list@xlk.org.uk
File Name: nilmtk/electric.py
Class Name: Electric
Method Name: activity_distribution
Project Name: pandas-dev/pandas
Commit Name: 545a942424a26c4163e1f959ac6130984fc3fb41
Time: 2020-12-23
Author: jbrockmendel@gmail.com
File Name: pandas/tests/reshape/concat/test_datetimes.py
Class Name: TestDatetimeConcat
Method Name: test_concat_multiindex_datetime_object_index
Project Name: okfn-brasil/serenata-de-amor
Commit Name: 2b268201631fd2eb2a7c012564bd65464662eaf1
Time: 2018-09-04
Author: irio@protonmail.com
File Name: jarbas/chamber_of_deputies/tests/test_reimbursements_command.py
Class Name: TestFileLoader
Method Name: test_reimbursement_property