Building a free tableau training in the public light (part 2)

Building a free tableau training in the public light (part 2)

So what do you do? Share the same news on LinkedIn! Hey I’m Tyler Garrett, I’m on a journey to document as much of tableau as possible before they update the UX again! lol.

However on LinkedIn no one seems to care. Maybe I’m no good at Linkedin!

However on twitter. Things are much different.

Well it’s good that building this tableau training for free in the public light is going pretty good from a social drip perspective. It’s definitely validating to see people cheering me on too.

Tableau training built by trainer is always going to be rather focused on material, rather I’ve done training based on professional experiences and people bring their worst workbooks to the call. That’s why I enjoy Tableau Consulting Services a lot, from a business perspective, and I love the challenges that come from being extremely diligent with the tool for 8 years. The patterns are rather mesmerizing. Glad to be finally documenting it all in Figma.

I have a good understanding of this product. So much so that I’ve not needed to research anything except 1 aspect of the product.

Here’s a link to the failed attempt of getting support or interest in the realm of LinkedIn.

Feel free to add me on Linkedin. Or twitter. Excited to share more about this free training in the future.

Until then back to figma. Lots to document!

screenshot of figma, showing tableau desktop explained in a wireframe style

Screenshot of figma, showing how Tyler Garrett is generating a wireframe for a one page learner per panel in tableau desktop as a free tableau training.

 

Building a free tableau training in the public light (part 1)

Building a free tableau training in the public light (part 1)

Over the last few weeks I’ve been training Dave in Tableau. However while getting pulled away I’ve been unable to sit down and talk through tableau without getting pulled away a few times. In my mind the best tableau training is two hours long and then you go build a few things. First you want to start with the basics and that’s often “here’s this button or here’s that button.”

a screenshot of figma where tyler is building a one page explanation of tableau desktops buttons in the top left of the tool bar.

A screenshot of tableau desktop with edits and explanation by tyler garrett

During our first training session, I opted into teaching Dave like an engineer. I enjoy training engineers through the product from left to right, top left more specifically.

Like reading a book in english. Top left then work your way right. While doing this I found myself talking a lot about how little I’m using certain aspects of the product and also what it means to use certain aspects of the product. Most of the time when developing in tableau you’re faced with what tableau can’t do and the requirements. My goal with all of this documentation and building tableau training in the public light that more people will find success with tableau and build a life of their dreams. If you’re interested in learning more about this free tableau training, feel free to contact me on twitter. The future ill leave more accessible links to get to this content here.

Some public opinion on my tableau-ing.

Learn more here; https://posts.gle/ofcsK1 this is related to free tableau training.

List Comprehensions – Learning Python List Comprehensions w/ a non-developer

List Comprehensions – Learning Python List Comprehensions w/ a non-developer

Building a list is a very specific building block in learning code, being a data analyst, or whatever data driven role you find yourself sitting in.

Python List comprehensions provide a concise way to create lists. Common applications are to make new lists where each element is the result of some operations applied to each member of another sequence or iterable, or to create a subsequence of those elements that satisfy a certain condition. (from python)

What is list comprehensions? i for i

List comprehensions is the name of a way to create lists. A more technical rationale would be that list comprehensions provide a more concise way to create lists.

Before we begin, let’s discuss two simple methods to printing our list comprehensions.

print [i for i in range(3)]

Or we can use a letter, word, or letters+words. We will only use this method below.

x = [i for i in range(3)]
print x

Below, I will explain how to use list comprehensions, what list comprehensions is all about, and various ways to use list comprehensions when utilizing Python! Woohoo, getting excited, I can tell. (I can’t, I’m weird)

What is the goal with list comprehensions?

It is proposed to allow conditional construction of list literals using for and if clauses. It’s like you haven’t heard of either of these today, if so, go check out python’s website on list comprehensions. If this does make sense, you may also be interested to know the proposed solution not only lets you generate conditional lists with for and if, they would nest the same way for loops and if statements nest now.

About the tutorials below.
If you’re not entirely sure what any of the above text means, woohoo. You’re on the right track, you’re on the right blog, and if you do know the techie words above, but not entirely sure what it means in code, or in python… Check it out…

Tutorial 1, making a simple list of data in python using List Comprehensions

There are two different ways to make a list of numbers in python.

Take a look at List Comprehension and another more complicated method.

Assuming you have a basic python install and you’re able to do the 2+2 to get 4 in python.

Easy method to make a simple list in python.

x = [i for i in range(10)]
print x

#Output
## >>>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Complex method to make a simple list in python.

x2 = []
for x3 in range(10):
x2.append(x3)
print x2

#Output
## >>>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Both X and X2 generate the same output!

We will focus on the Easy method known as “List comprehension”

Notice we are using a different letter in the list comprehension code below.
When learning python, a lot of example code has “words” which can be changed to letters. Like below, I’m using a “y”… Later in this tutorial or lesson… I’m going to keep changing the “y”, which is the results of the list comprehension in python below!

y = [i for i in range(11)]
print y

You may be thinking, okay, we are increasing the numbers each time, and changing the letter in the beginning. That’s true, it’s a nice little pyramid if you run every bit of code together, which is pretty cool to know… You might be copy pasting different pieces of the code, and in this particular chunk of code, you can run the entire set of code, and not need to worry about anything! It will give you a results of our list comprehension code, which is clearly marked as “print” “firstletter”… easy enough to keep up with.. here’s a curve ball, I changed i to meow, and that works too.

z = [meow for meow in range(12)]
print z

This list comprehension code below has more than a letter, similar to the complex list generation code above, we used x2 (example 2), and similarly, we are not using a letter to describe the results of the list comprehension. For the new programmers -> Light bulb moment? You can name the “X”, “Y”, “Z” anything you damn please… If you’re following here, you should now see a pattern, and easy pattern to generate simple lists with a range of #’s. Also, you might be seeing a little bit of math. How exciting! You’re doing math, in python!

tyler = [i for i in range(14-1)]
print tyler

In the list comprehension below, I’m simply demonstrating addition… On the range() portion of the code.

tyler2 = [DOG for DOG in range(12+2)]
print tyler2

More math, yes division, multiplication, subtraction and addition work in python, pretty well too..

I tested, it’s accurate.

tyler3 = [i for i in range(14/2+7+1)]
print tyler3

#All results should look like:

#[0, 1, 2]
#[0, 1, 2]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]

The next few tutorials on list comprehensions will be right up your alley, if you understand the techie mumbo jumbo this will be a good refresh and a hilarious chunk of code you can likely help optimize, and I will gladly add anyone in the tutorial blog posts – and link to whatever website, github profile, etc, and help you rank better. As a novice at all things python, I’m excited to get to know you more as you take the journey I once took. I’m excited to get to know people who think this is total trash too. I need that kind of feedback. I’m learning every day, coding is hard, and I only know what I know, and that means if someone could show me all the ways the code works, I will master the code, otherwise I’m MR. Trial and error. so longest story short, you’re here to learn, me too, so let’s get started by learning everything there is to know about list comprehensions.

python list comprehensions is as necessary as eating this shaved ice desert

Python list comprehensions is as necessary as eating this shaved ice desert.

List comprehensions are powerful but poorly explained by the current top two ranking websites. That’s because they are…

  1. the company website – very smart stuff
  2. some random blog with affiliate links and viruses, popup ads..

I’m excited to show you a proper list comprehensions tutorial, without a single pop up, google ad, or affiliate link.

Pythonforbeginners sold their blog off for marginal return. Popup ads in 2018…

Making Lists in Python – List Comprehensions

Some may call this an “i for i” + “python” on google!

Why is Tyler Garrett rebuilding the wiki on List comprehensions?

The current content when googling i for i python or list comprehensions, is currently plundered with garbage water.

Automate generating a list of values using python 2.X
List comprehensions 101…

If you are new, eager to learn quickly, want to learn without having to code, need lots of examples… Looking for a lot of sample code, that tests a lot of different variations of list comprehensions, or maybe… You looked online, didn’t find anything decent, a little upset trying to learn python, need a better guide… Maybe it’s just me.

Cool, that’s why I write, to replace the TRASH WATER blogs online. No monetizing, no click ads, just solutions.

Find and Replace in a CSV using Python

Find and Replace in a CSV using Python

Below is a quick tutorial on using a type of “find and replace” across a CSV file or you could do this find and replace on a TXT file too.

I’m not a developer, just another blogger, blogging about learning python.

I’m building use cases that are similar to a typical business analyst or data analyst.

The goal is to build a user friend guide, that allows end users with any skill level to understand the methods used to handle “find and replace” in a file, using python.

You get a CSV file or TEXT file and want to scrape over the entire file, and output it with your modifications. Find and replace is the term I would think you would google if you wanted to do a find and replace in python over a CSV.

Here’s a typical CSV file.
Delimited by a comma.

Name,Number,Rank,Website,Flag,Cat
Tyler,43,1,https://tylergarrett.com,Yes,0
Jeff,36,2,https://tylergarrett.com,No,0
Isabelle,57,3,https://tylergarrett.com,Yes,0
Mury,84,4,https://tyler-garrett.com,No,0
Meow,96,6,https://tylergarrett.com,Yes,1
Cats,25,5,https://tylergarr3tt.com,no,1

→ Save file as input.csv

Python, without any downloaded libraries, will do a find and replace on the data above. You can copy and paste the data above into a .txt file, and change the extension to .csv — if you don’t have an excel software on your computer, or you can use Google sheets and make your own data problem.

Our goal is to clean the 3.

The 3 in the https://tylergarr3tt.com link because it’s not accurate.

For whatever reason this is going to be used by a developer and they are asking me to find and replace the “errors.”

Errors in the sample data generate a use case to learn how to do a find and replace on a CSV file, which taught me that using the a previous “text file” tutorial, I was able to handle the same ETL like solution, with simple python code, and no odd libraries to be imported.

No downloaded libraries means you’re free to only get access to python on your work station, this is key in enterprise situations where every new download becomes a new request of your IT department. A new request means a new approval from your manager too.

by tyler garrett

Our use case will generate a full “find and replace python solution” and a few more obvious data issues.

We will remove “3” and replace it with “e” in python below, to help us move down a path of learning and solving your use case today.

The code to find and replace anything on a CSV using python

text = open("input.csv", "r")
text = ''.join([i for i in text]) \
    .replace("3", "e")
x = open("output.csv","w")
x.writelines(text)
x.close()

We are not using any “imports” because this is all native python capability.

Let’s see what the output looks like.

Name,Number,Rank,Website,Flag,Cat
Tyler,4e,1,https://tylergarrett.com,Yes,0
Jeff,e6,2,https://tylergarrett.com,No,0
Isabelle,57,e,https://tylergarrett.com,Yes,0
Mury,84,4,https://tyler-garrett.com,No,0
Meow,96,6,https://tylergarrett.com,Yes,1
Cats,25,5,https://tylergarrett.com,no,1

Successfully cleaning the “3” and also adding an “e” where our “3” used to be.

Look at line 2 & line 3 before:

Jeff,36,2,https://tylergarrett.com,No,0
Isabelle,57,3,https://tylergarrett.com,Yes,0

Look at line 2 & line 3 after:

Jeff,e6,2,https://tylergarrett.com,No,0
Isabelle,57,e,https://tylergarrett.com,Yes,0

The small portion of code:

text = ''.join([i for i in text]) \
    .replace("3", "e")

Allows you to “find and replace” using one line of code.

It looks like 2 lines of code because python lets you put a space and a “\” in front of a long line of code. The space + “\” lets me see what I’m doing easier that writing one wrapping line of code.

An example that may require a “ \” in front of your code, looks something like…because it’s easier to read.

Simple python transformation can be complicated.

Above image of code is an exaggeration to show you that python lets you break up your find and replace or you can do it in one line. I do it because I would go absolutely crazy if it wasn’t for that little feature, so if you’re like me, woop woop. This is a big help, otherwise

→write it like this…

text = ''.join([i for i in text]).replace("3", "e")

Above code lets us quickly replace “3”’s with “e”’s and lets us heal our link column in the csv file. Find and replace may require a more granular approach which will be covered in another lesson.

Final code to find and replace text in a CSV with python

Find and replace text or letters in a csv with python is simple, super fast, faster than any SQL stuff I’ve played with in the past, so — if you need to bulk process a CSV or TEXT file — python is a great direction because it’s easy to understand.

text = open("input.csv", "r")
text = ''.join([i for i in text]).replace("3", "e")
x = open("output.csv","w")
x.writelines(text)
x.close()

‘’.join is cool because it allows you to add anything, to each row of data.

Notice how…

text = '1'.join([i for i in text]) \

Adds a “1” to each row of data…

Name,Number,Rank,Website,Flag,Cat
1Tyler,4e,1,https://tylergarrett.com,Yes,0
1Jeff,e6,2,https://tylergarrett.com,No,0
1Isabelle,57,e,https://tylergarrett.com,Yes,0
1Mury,84,4,https://tyler-garrett.com,No,0
1Meow,96,6,https://tylergarrett.com,Yes,1
1Cats,25,5,https://tylergarrett.com,no,1

How exciting…

text = open("input.csv", "r")
text = '1.......+'.join([i for i in text]) \
    .replace("3", "e") \
    .replace('+','+\n')
x = open("output.csv","w")
x.writelines(text)
x.close()

Generates…

Name,Number,Rank,Website,Flag,Cat
1.......
Tyler,4e,1,https://tylergarrett.com,Yes,0
1.......
Jeff,e6,2,https://tylergarrett.com,No,0
1.......
Isabelle,57,e,https://tylergarrett.com,Yes,0
1.......
Mury,84,4,https://tyler-garrett.com,No,0
1.......
Meow,96,6,https://tylergarrett.com,Yes,1
1.......
Cats,25,5,https://tylergarrett.com,no,1

Find and replace in python, using the basics. You can use a .txt file too, for both input and output.

Later you will learn split() is a lot of fun to use.

By Tyler Garrett

Built a Tableau Consulting thing and now i do other stuff.

Finding Correlations in Public Data Sources

Finding Correlations in Public Data Sources

Can you choose different public data sources quickly, efficiently, and use that data for data science too? Finding correlations in public data sources used to be a lot of work to wrangle.

What I said above, for most, would require multiple people.

  1.       Data architect – helps you architect your data
  2.       Database admin – helps you access your data
  3.       Data scientist – helps you with predictive analytics
  4.       Developer – migrates data science models into code
  5.       BI Developer – helps you build a dashboard
Finding Correlations in Public Data Sources is like finding the right VM in silicon valley.
Finding Correlations in Public Data Sources is like finding the right VM in Silicon Valley.

We always intend to find correlations in public data sources.

Finding correlations in public data sources is a lot like finding a pattern on your wallpaper.

It takes consideration, time, planning, counting, memorizing, anyways…

But now we can automate most of this stuff 😉

Our prediction is that ethnicity, deaths, births, birth fertility, homelessness, and dozens of more measures will offer insights into average survey scores.

public data sources databases wrangled
Finding data sources online can take time, below we offer a few great resources. Artwork found here.

The more our measures correlate, the better we can predict our future.

Remember before reading the findings that statistics are opinionated. Correlation does not mean causation.

Noticing trends in our data sources.

Here’s a scatter plot displaying HCA survey average scores per state and Total Homelessness in 2014. The points on the graph are individual states. You will notice a negative trend sloping down as the survey scores increase, the amount of homeless people decreases too.

Tyler Garrett photo + design Finding Correlations in Public Data Sources
Finding correlations in public data sources on a laptop is possible.

Scoring correlations in our data sources.

If we score the correlation between the two values, across every state, it would enable us to determine what metrics follow a similar pattern.

With scores, we can understand what correlates the most, or does not correlate to the hospital survey scores.

There are hundreds of hospitals per state. Here’s the top ten bar chart, showing how many hospitals per state are being averaged.

Mastering Multiple Public Data Sources

If you want to bring multiple data sources together, you need to be very good at SQL, data manipulation, data architecture, and a lot of spare time in a spreadsheet if this sounds like new skills. Finding correlations is another beast.

Finding a data scientist in your office may be tricky if they are busy or not available, which generates a deep dive in learning R, Python, Statistics, or Excel martial arts.

Luckily, we KNIME our data, which means we can do all the complex SQL, data manipulation, data architecture, and pipe it through a data science model, in the same window.

What would have taken my group multiple weeks of constant work, only took us 1.5 hours!

Looking for a public data source?

Know that picking a public data source has become readily available in the past few years, and being able to quickly identify powerful data sources has become a distinguishable skill to master.

oh shit using a lot of data sources is hard
Oh shit!

If you are interested in picking up this skill, read our solution below.

I stumbled on this request in a team project last week!

“Everyone, pick multiple data sources…”

This can sound like an easy request…

  1.       Where do you get your data?
  2.       What data is accurate?
  3.       What source of data can we trust?
  4.       What decisions are we attempting to make?

We want to find data sources that will add value to our audience, their questions will have answers, and their next steps will be clear.

In this blog, you will learn how…

You will learn how our team quickly accomplished our project using one simple whiteboarding methodology.

You’re probably thinking, ‘Yes, of course, I can pick a data source, I’m passionate about x, y, z.’

The more you grow in the data industry, the more you realize every new data source comes with new hurdles or barriers to entry.

Is the data clean? Is the data usable? Do we have access to the data?

You begin applying padding around your work, based on previous experiences, and avoid painful experiences.

If you choose to read this entirely, you will be armed with a solution to any brainstorming meeting, and you will learn where we found 3 different data sources online.

That’s right, I’m talking about your future in data.

Eventually, you’re going to hit that ten-year threshold. A decade of database-related solutions.

When you hit ten years, you start to become scared of ‘lots of disparate data sources,’ and learn to avoid these workloads.

When your meeting is going great… Get ready for that meeting to slow down.

Someone is around the corner to suggest another table of data…

The data source will put the brakes on your progress. A new data source that has never been cleaned, prepped, approved… Major ‘nope’ in my line of work…

You were asked, “What data source do you want to use?”

Feel free to play along, mentally put yourself in a group setting, and give yourself a few minutes to pick multiple data sources to present in front of a class of 40 professional peers.

You will be building decisions out of these data sources. Graphs, pie charts, forecasting, insights, etc.

Lastly, work as a team to generate a data solution surrounding these data sources. While you’re at it, don’t get too involved in figuring out what answers you will gain from your data source.

We were tasked to generate a project to kick-start our success stories. In this process, it seemed really challenging to decide on what to choose.

It was interesting because even though we were all eager to get started… We struggled to find the right granularity.

You have access to making documents aka superpowers!

Data lakes, big data, data warehouses, … Each row of data offers a granularity.

Are we looking for an address? Zip code? State? Country?

Stating different parent and child relationships are all great and good. But until these words hit a piece of paper, Google Slides, or a whiteboard… We are left remembering what was said and making decisions based on our memory.

A zip code would be a more granular view of your data than State…

But without documenting our decisions, how do we collectively come together to suggest a path forward?

Also, why am I talking about documents?

Well – documentation is really helpful and it’s tangible information you can point at and say, “LOOK”… and in return, you will likely receive feedback.

Finding multiple data sources in any single industry can feel like a daunting task.

When you’re actively finding multiple public data sources – there are a lot of options.

Noticed we just said “public data sources”…

Yes, as opposed to a private data source! If you’re new in the data industry, let me dive in.

  1.       Public data source – safe to download, safe to share, available for everyone.
  2.       Private data source – not safe to download, not safe to share, not available for everyone.

Here are a few up and coming data source providers. These are public data sets and available to everyone.

  1.      www.kaggle.com
  2.      www.data.world
  3.      www.data.gov

Remember – public data sources are like a Wiki.

Here’s my ‘buyer beware.’ Or maybe we should say ‘extracter beware.’

Anyone can add a data source, anyone can change the data source, and Wiki’s are public – anyone can make an edit. That’s why teachers recommend we avoid using them in scholarly reports because some random person likely added that information on the Wiki.

How did our team pick a data source?

Originally, we struggled to find a data source because we were not documenting our ideas.

Our ideas were lost as soon as we said “anything” out loud.

We would say a great idea, agree it was a great idea, but failed to generate next steps.

What made a difference was documenting our brainstorming session on the dry erase board.

Having everything on the whiteboard allowed everyone to see what was being said.

Not sure how to get started whiteboarding?

Whiteboarding is usually as simple as making a word cloud and circling good items and drawing a line through bad items.

Learn more about advanced analytics on my other blogs.
For example, on my LinkedIn, I write about spatial filtering Google analytics data.
https://www.linkedin.com/pulse/oh-boy-i-wrong-time-spatial-filtering-tyler-garrett/

Homeless Data per State

Homeless Data per State

Homeless data per state – this data source offers insights into sheltered, unsheltered, and chronically homeless families, individuals, and unaccompanied youth.

My hypothesis is that if you have a lot of homeless people in your state, you also have bad survey scores, and that correlation is easy enough to see with a scatter plot.

Data.gov offers insights into other measure values that could hold statistical relevance, visit the website for more details.

Homeless data vs HCAHPS Hospital Survey Data per state, showing a negative trend and strong correlation.

Homeless data vs HCAHPS Hospital Survey Data per state, showing a negative trend and strong correlation.

Website – https://catalog.data.gov/dataset/ahar-part-1-pit-estimates-of-homelessness

The table below demonstrates Pearson Correlation value and a p-value, to determine its statistical relevance. The smaller the p-value, the more significant our data becomes.

We are using Pearson Correlation to compare the HCAHPS hospital survey data against different ways to categorize the count of homeless people per state. Sheltered Homeless Individuals and Sheltered Unaccompanied Youth are the most statistically relevant.

Measure Name Pearson
Correlation
p-value
S_HomelessIndividual -0.54017 0.000051453
S_UnaccompaniedYouth -0.52146 0.00010311
TotalHomeless2014 -0.51123 0.00014825
S_HomelessUnaccomp
YoungAdults
-0.50765 0.00016788
S_ChronicallyHomeless -0.50304 0.00019669
S_Homeless -0.49385 0.00026775
S_Chronically
HomelessIndividuals
-0.4899 0.0003049
S_HomelessVeterans -0.48562 0.00035051
HomelessIndividuals -0.47243 0.00053198