Advertisement · 728 × 90
#
Hashtag
#100DaysOfPolars
Advertisement · 728 × 90
Post image

Dates are weired. E.g American dates begin with month.

@pola.rs makes it easy to change the way your dates look, depending on the audience.

Here's short and long text date formats. You can do more!

This is the final #100DaysOfPolars post.

Find all the posts here
www.conterval.com/blog/#catego...

1 0 0 0
index

Also for future reference, I'll be archiving all the #100DaysOfPolars posts here

www.conterval.com/blog/#catego...

1 0 0 0
Post image

JSON data can be nested on multiple levels. But @pola.rs has a way to convert it to tabular format based on the level of your choosing.

Best for dealing with API data or web requests in JSON.

Even more ways to use Polars in the course www.udemy.com/course/analy...

#100DaysOfPolars
#data

4 1 2 0
Post image

You have a table of passwords and (for whatever reason) you want to count the number of digits in each password.

Here's how to do it with @pola.rs

Even more ways to use Polars in the course www.udemy.com/course/analy...

#100DaysOfPolars
#datasky

1 0 0 0
Post image

He is a nice trick to demonstrate how versatile @pola.rs is.

I have parts of a phone number and want to join them into a complete phone number.

More tricks in the Polars course www.udemy.com/course/analy...

#100DaysOfPolars
#datasky

1 0 0 0
Post image

What if you wanted to round time the way round decimal numbers? Well, sort of

Here, I use @pola.rs to scan a 10 minute interval and make the value in between same as the lower bound. So minutes between 0 and 10 become 0, minutes between 10 and 20 become 10 etc.

#100DaysOfPolars
#datasky

1 0 0 0
Post image

In @pola.rs, it's very easy to make the first letter of each word a capital letter.

Here, I properly punctuate the book titles of some of my favorite authors.

#100DaysOfPolars
#datasky

1 0 0 0
Post image

When you have timeseries data, @pola.rs has a special type of grouping that lets you be a lot more granular in your grouping.

Here, we see the total power usage every 5 hours and 30 minutes. Now that's granular!

#100DaysOfPolars
#datasky

1 0 0 0
Post image

When you change the timezone on your date column, the time also changes. What if you want to change the timezone but maintain the time?

Here's how to do it in @pola.rs

#100DaysOfPolars
#data

1 0 0 0
Post image

Data analysis involves neglecting certain rows and focusing on specific rows of data.

Here we use @pola.rs to neglect all rows and focus on one row with the maximum grade.

Even more ways to use Polars in this course www.udemy.com/course/analy...

#100DaysOfPolars
#datasky

1 0 0 0
Post image

You have a large Parquet dataset. You want to find out what columns it has and the data types of those columns—without reading the entire dataset.

@pola.rs can help you do just that!

Even more way to use Polars in this course www.udemy.com/course/analy...

#100DaysOfPolars
#datasky

2 0 0 0
Post image

You are querying a historical database with dates, and you want to create another column of centuries for those dates.

@pola.rs makes it super easy to do this.

Look there's a Polars course www.udemy.com/course/analy...

#100DaysOfPolars
#datasky

2 0 0 0
Post image

Sometimes you may have a column identified as a string when it's supposed to be a decimal.

Here, I use @pola.rs to convert the data type to decimal.

This is different from float type. You can see in the type that the max number of digits after the decimal point is 2.

#100DaysOfPolars
#datasky

2 0 0 0
Post image

Most people read CSV files and then change the data type of columns. That's an amateur way.

The pro way is to do it all at once. Here, I use @pola.rs to change the data type of Day_Count from number to text.

Learn more in the Polars course www.udemy.com/course/analy...

#100DaysOfPolars
#datasky

4 0 0 0
Post image

Counting the number of days between dates is super easy in @pola.rs

Learn more in the Polars course www.udemy.com/course/analy...

#100DaysOfPolars
#datasky

1 0 0 0
Post image

The number of characters in text is not always the same as the number of bytes. Especially when the text contains emojis.

@pola.rs helps us here to count characters and bytes in text.

#100DaysOfPolars
#datasky

1 0 0 0
Post image

You have part numbers for your products, but you want to make sure that they all have 6 characters to maintain same length.

Here, we use @pola.rs to add zeros at the end of product numbers with less than 6 characters.

#100DaysOfPolars
#datasky

1 0 0 0
Post image

You have data in table 2 and table 2. But you want to find values that are in table 1 and not in table 2.

Here, we use @pola.rs to get names of students who failed the exam from the list of all students.

If you're into math, this is the same as set difference.

#100DaysOfPolars
#datasky

1 0 0 0
Post image

You have a table with repeating names and want to get the index where each unique name appear.

Here, we use @pola.rs to get the first appearance of each name.

#100DaysOfPolars
#datasky

1 0 0 0
Post image

Most people read a CSV file with bad column names, and then rename those bad column names. Stop doing that.

Here, we use @pola.rs to read a CSV file by specifying what we want to call the columns.

#100DaysOfPolars
#datasky

1 0 0 0
Post image

With @pola.rs you can convert dates to timestamp in milliseconds.

Here, we show the milliseconds that passed since 1 Jan 1970 when Unix time counting starts.

#100DaysOfPolars
#datasky

1 0 0 0
Post image

@pola.rs has has a special data type that allows you to filter text values based on hierarchy.

Here we get people who have a master's degree or higher.

#100DaysOfPolars
#datasky

1 0 1 0
Post image

You have a table with appointment dates.

Here's how you can change the dates by 5 days or by 1 month in @pola.rs

#100DaysOfPolars
#datasky

1 0 0 0
Post image

You have the chance of 1 event happening. You want to find the chance of 2 or more events happening.

Here, we use @pola.rs to find the chance of you getting into Harvard, becoming a billionaire, being happily married and dying a hero.

It's about 1 in 21 thousand!

#100DaysOfPolars
#datasky

1 0 0 0
Post image

Here's how you can get the index of the rows where a specific value appears in @pola.rs

I wanted to get the row numbers where the student named Aria appears.

#100DaysOfPolars
#datasky

1 0 0 0
Post image

Data is never clean and missing values are almost inevitable.

Here's how to quickly check the number of missing vales contained in each column with @pola.rs

#100DaysOfPolars
#datasky

1 0 0 0
Post image

@pola.rs has a special data type struct which is handy when storing data without using to much memory.

However, doing tabular operations on structs can be difficult. Luckily, it's super easy to get data out of the struct into respective columns.

#100DaysOfPolars
#datasky

1 0 0 0
Post image

With @pola.rs, you can reverse the dataframe so that the last row is the first.

Here, I reverse my itinerary so that my final destination is Los Angeles not Tokio.

#100DaysOfPolars
#datasky

1 0 0 0
Post image

@pola.rs allows you to target the dataframe down to the specific like selecting a value in a specific cell of the table.

Here, I pick the streaming service I've never subscribed to.

#100DaysOfPolars
#datasky

1 0 0 0
Post image

With @pola.rs, you can insert a column into a dataframe at whatever position you want.

Here, we're inserting the column movie to be the first column in the dataframe.

Learn more in the Polars course www.udemy.com/course/analy...

#100DaysOfPolars
#datasky

1 0 0 0