<jupyter_start><jupyter_text>**测试公共部分私有为0数据是否是正确的数值，或是其他原因导致的具有干扰性的数据<jupyter_code># General imports
import numpy as np
import pandas as pd
import gc
train = pd.read_csv('../input/ashrae-energy-prediction/train.csv')
train['ny_time'] = train.timestamp.apply(lambda x:x.replace('2016', '2017'))
train['nyy_time'] = train.timestamp.apply(lambda x:x.replace('2016', '2018'))

train["timestamp"] = pd.to_datetime(train["timestamp"])

train_exception = pd.read_pickle('../output/ashrae-eda-2/train_exception.pkl')
train['exception'] = train_exception.exception.values
del train_exception
gc.collect()
test = pd.read_csv('../input/ashrae-energy-prediction/test.csv')
# test["timestamp"] = pd.to_datetime(test["timestamp"])
temp_df = train[['building_id', 'meter', 'ny_time', 'exception']]
temp_df['timestamp'] = temp_df['ny_time'].values
del temp_df['ny_time']
gc.collect()
test = test.merge(temp_df, on=['building_id', 'meter', 'timestamp'], how='left')
gc.collect()
gc.collect()
temp_df = train[['building_id', 'meter', 'nyy_time', 'exception']]
temp_df['timestamp'] = temp_df['nyy_time'].values
del temp_df['nyy_time']
gc.collect()
test = test.merge(temp_df, on=['building_id', 'meter', 'timestamp'], how='left')
gc.collect()
del train, temp_df
gc.collect()
test.loc[test.exception_y.notna(), 'exception_x'] = test.loc[test.exception_y.notna(), 'exception_y'].values
test['exception'] = test.exception_x.values
del test['exception_x']
del test['exception_y']
gc.collect()
test.exception.value_counts(dropna=False)
test[['exception']].to_pickle('../output/ashrae-test-exception-label/test_exception.pkl')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19079754601226995, 'fraction_numerical': 0.011042944785276074, 'mean_word_length': 8.214689265536723, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '256790', 'license': 'MIT', 'n_tokens_mistral': 618, 'n_tokens_neox': 604, 'n_words': 88, 'path': 'solutions/rank-4/exception_label/ashrae-test-exception-label.ipynb', 'repo_name': 'madesgriya/ashrae-great-energy-predictor-3-solution-analysis', 'size': '1630'}