Data aggregation and split train test samples I'm working on a data science project where the goal is to predict daily electricity consumption of a building based on some of its characteristics (e.g., size, location, etc.) and weather features (e.g., temperature, humidity, wind, rain, sun radiation). 

Some of my weather features (temperature, humidity, wind) are in hourly intervals and others in daily intervals (rain, sun radiation). 
My target (daily electricity consumption) is also in hourly intervals.

My goal is to predict daily consumption so I need to aggregate my input data at a daily interval (sum of 24 values for consumption, average of 24 temperatures, ....)

My question is: Do I have to aggregate the data before split train/test of after ?

If I do aggregation first, I will consider only those days with 24 values (one for each hour) and drop others in order to not introduce bias
Then I will split train/test. So basically, I will clean my data before splitting.

Am I missing something?
If you are training the model based on the aggregated values anyway then it wouldn't make any difference on the final dataset that is fed to the model.

You might consider aggregating earlier in your pipeline as to reduce the amount of work that has to be done afterwards (whatever steps you go through).  Aggregating means less data points, so following steps will run faster.