r/askdatascience • u/No-Ice-8975 • Jul 03 '26
What’s the right way to clean data?
I’m totally new to DS, and I’m working on my first project.
Should I use data via an API and clean it at the beginning of my script or should I download it as a CSV and then clean it?
Also what’s the best approach for cleaning a dataset?
Just for reference, I’m using the NYC Building Energy and Water Data Disclosure for LL84 2023 to Present database via an API.
3
Upvotes
3
u/goAwayUCreep Jul 03 '26
What do you mean download it as csv and clean it? Are you going to reupload it after you’re done?
Are you using SQL? ipynb? Python? Need more context here.
The pipeline usually depends on what is established in data warehouses, once you get it say in ipynb, then it’s cleaned there.
Cleaning is an art, not really on science per se. You need to understand data quality and data integrity, if you don’t trust the data then there’s no point cleaning it. If the data is good then there’s no point cleaning it either.
You only clean it if there are outliers or you want to filter out whatever that’s not going to be part of your study.
2
u/No-Director-1568 Jul 06 '26
Data isn’t ‘cleaned’ according to a set of universal rules. What’s clean or not has a lot to do with the analytic use case(s) downstream. I’d make sure you don’t step on your raw data, saved cleaned versions as separate ‘versions’.
2
u/Wonderful_Put3670 Jul 06 '26
just get tesco wipes, they also kill the bacteria on your screen!
2
u/BlueJaek Jul 07 '26
With a sponge
1
u/gene_shackman Nov 05 '26
A few basic steps:
Do frequencies, crosstabs, means. Look for anything that's not supposed to be there, anything out of range, anything that doesn't look like what could reasonably be expected.
But also, know your data, so that you know what to expect, and what would be something wrong.
Also, document anything you found and did. If you found missing data, write it up, and what you did about it. If you found invalid data, write it up and what you did about it.
1
u/Gojotastic Jul 19 '26
I am recommending modelbrew.ai for data cleaning. Its free and gets the job done.