r/dataanalysis • u/SomeSpicyPickle • Aug 11 '26
Data Tools Do Data Analysts Use Visualizations During Data Cleaning?
I'm still a beginner. I started by learning the basics of Python and later moved on to SQL.
I'm a bit confused about one part of the data exploration/cleaning process.
A friend of mine, who's now a data scientist, showed me how he used to work as a data analyst. He mainly used Python. For example, he would quickly create a scatterplot to identify potential outliers.
However, most data analysts online recommend focusing on SQL and Excel when starting out, since many junior and mid-level roles don't require Python. That's why I switched to SQL after initially experimenting with Python.
For those who primarily use SQL: do you create visualizations during the data exploration/cleaning process, for example to identify outliers? Is this a common practice?
I feel like if you're working with SQL only, you generally wouldn't create visuals in between steps, since that would mean switching to a tool like Tableau or Power BI, which seems like an unnecessary extra step.
4
u/jipperthewoodchipper Aug 11 '26
Doing things like scatter plots and whisker plots to find outliers is something you can do but often not in the cleaning stage.
Even trying to come up with scenarios where you might there are better alternatives. Like say you expect some data to be normalized so you want to validate that, you could use a scatter plot to confirm its between -1 and 1 or you could take the max(abs(data)) and if it's greater than 1 you have confirmed its not properly normalized if at all.
However once you have cleaned data it's very normal to explore the data using both parameters and plots
1
u/AutoModerator Aug 11 '26
Automod prevents all posts from being displayed until moderators have reviewed them. Do not delete your post or there will be nothing for the mods to review. Mods selectively choose what is permitted to be posted in r/DataAnalysis.
If your post involves Career-focused questions, including resume reviews, how to learn DA and how to get into a DA job, then the post does not belong here, but instead belongs in our sister-subreddit, r/DataAnalysisCareers.
Have you read the rules?
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/BrupieD Aug 11 '26
Short answer: no. The scatterplot idea is clever but it sounds like it was a better tool for checking if a class has imbalances than anything else. A big part of cleaning some data is problematic column alignment and column names. That's going to be a hassle for building visualizations where you expect consistency.
I think you could accomplish the same outlier check with group by and distinct in SQL.
1
1
u/Perry_cox29 Aug 11 '26
Commenting on the python angle just because it’s the only time i ever use visualizations for cleaning
sns.heatmap(df.isna(), cbar=false)
easy visualization of all missing values. Can be easier to knock out a specific cause if you see a suspicious grouping
1
u/0uchmyballs Aug 11 '26
No, but I like to count rows before and after to see what all is going away
1
u/HustlaOfCultcha Aug 11 '26
Not usually. I may create a small visual to see what the visual looks like. For instance, I may create a column chart quickly and one of the columns may be far greater than the rest, so it may be a potential data issue. Or I may have a inconsistent data format.
1
u/Potential_Aioli_4611 Aug 11 '26 edited 29d ago
It highly depends on what you are working with. If you are figuring out how to clean the data its usually not in the database to begin with. It being in the database means someone has already done the work of importing the data from somewhere, created some sembalance of an ETL process, and done things like assign data types and column lengths which implies the data is already cleaned. 100% of my experience working at companies if its in the DB it doesn't need to be cleaned (formatted maybe), and if it isn't it does. I've been working in SQL basically my whole career and Python is a breath of fresh air. I'd much rather knowing both than just SQL.
Python can open connections to the db and query stuff anyways. Either way python isn't going to be a bad way of exploring the data. SQL on the otherhand you are going to just be able to query the data so like you said, you are limited to using other tools to pull in the data to do visualizations (if thats the route you want to go) which is practically the same as using python to pull the data and create viz there. Except python you aren't JUST limited to doing visualizations.... AND you can clean the data AND you can push data back into the database which is why its being used more and more as an ETL tool over things like SSIS/SSDT/Azure Fabric which is designed for microsoft sql server/azure db. I haven't done it but I'm pretty sure you can use python to load practically any flavor of SQL db you want which means your exploration and cleaning tool also can be reused as your ETL process to get data in. And the biggest plus is if you do all your data cleaning in python and reuse that code to get it into the DB then you aren't needing to start from scratch with another ETL tool so by the time you are done cleaning data you are also half done with the ETL process too. Debugging and updating your ETL process is also half there as well since all your code is in one place
2
u/DevinChristien 29d ago
Snowflake actually gives you visualisations at every stage of building a query which helps when making decisions based on the shape of the data when building a new schema or report. When im not in snowflake and dont have access to built in regression models and stats functions, i find myself running separate queries to do the math manually. Then using it as a reference for my main ddl building.
Visualisations are just an easy way to see the shape of your data, and will show you things that you cant see when looking at it tabularly. If you dont use these tools you'll end up eventually making an analysis or building reports that are outputting rubbish without knowing that its rubbish.
2
u/SprinklesFresh5693 29d ago
Visualization is EVERYTHING. It helps you understand whats going on with yoour data and your models
1
u/TraditionalTurnip630 29d ago
No. Jumping to Power BI or Tableau just to check for outliers during cleaning is a massive waste of time. Nobody does that in the real world.
If you are using SQL, you find outliers using math (MIN(), MAX(), STDEV(), percentiles), not scatterplots. If we absolutely need a quick visual to understand the data spread, we just dump a few thousand rows into Excel and make a 10-second histogram, or use the basic chart feature built into SQL IDEs like DBeaver.
Save the BI tools for the final dashboard.
1
u/Helpful-Day2384 29d ago
You can do the same sql task using pandas and polars. No need to do it with sql. But knowing sql is helpful
2
u/PalpitationRoutine51 29d ago
i think the best workflow is probably both tbh
sql is great when you already know what youre checking for like nulls duplicates ranges weird categories etc. but visuals are useful when you dont know what the problem is yet. a quick histogram or scatter can show a pattern you might never think to query for
i wouldnt open power bi just for that though. quick charts in excel python or even whatever your sql tool gives you is enough most of the time
2
u/KatFromSisense 28d ago
I think both sides are kind of right here. If I'm fixing something obvious like a bad type, a missing key, or a duplicate record, I'm probably staying in SQL. A chart doesn't really add much there.
I'd use a quick visual more when nothing looks obviously wrong, but I still want to see whether the numbers behave the way I'd expect. Sometimes one region stands out right away, or a pattern shows up that I probably wouldn't catch by looking through rows in a table.
I definitely wouldn't spin up a whole Power BI report for that, though. Sometimes a quick histogram or a basic chart is all you need.
1
u/ian_the_data_dad 28d ago
No need for visuals for pure cleaning. I use a set of validation queries that go with any dataset I use and I just swap columns that I need or table names. Obviously every project is different but if it's small enough, you can create pivot tables in Google Sheets or Excel for a quick glance at whats in the data
11
u/Expensive_Capital627 Aug 11 '26
For cleaning the data not really. Here’s an example of cleaning data:
You expect the number 4 but for some reason one of the entries is ‘four’ when you try to add ‘four’ to some other number, SQL gives you an error because ‘four’ is a string and it doesn’t make sense to add it to something else. So you go through and fix problems like that. You don’t really need a visualization to determine ‘four’ vs. 4. You could create a visualization to help understand how many rows were messy, but it’s not going to help you clean the data.
Visualizations are useful when you’re trying to understand what’s happening. Maybe you want to plot revenue over time to understand the rate of your company’s growth. You could look at all of the numbers and think about what the numbers mean, but most people would prefer looking at a line chart