Data Science 100 Knocks (Structured Data Processing) – R Part1 (Q1 to Q20)

Articles in English

 

Commentary :

This code performs a series of operations on a data frame called df_receipt containing columns "customer_id" and "amount".

Here's a step-by-step explanation of what the code does:

df_receipt[c("customer_id", "amount")]: This selects only the "customer_id" and "amount" columns from the df_receipt data frame. The resulting data frame contains only these two columns.

%>%: This is the pipe operator in R, which is used to chain together multiple operations on a data frame. The output of one operation is passed as input to the next operation.

mutate(ranking = row_number(desc(amount))): This creates a new column called "ranking" in the data frame using the mutate function. The "ranking" column is based on the "amount" column, with the highest value of "amount" receiving a rank of 1, the second-highest value receiving a rank of 2, and so on. The desc function is used to sort the "amount" column in descending order.

arrange(ranking): This sorts the data frame by the "ranking" column in ascending order (i.e., from 1 to n).

slice(1:10): This selects the first 10 rows of the sorted data frame (i.e., the 10 rows with the highest "amount" values and their corresponding "customer_id" values). The slice function is used to subset rows from the data frame.

In summary, the code selects the "customer_id" and "amount" columns from a data frame, ranks the "amount" values in descending order, sorts the data frame by the rank, and selects the top 10 rows (i.e., the 10 customers with the highest "amount" values).
 
Data Science 100 Knocks (Structured Data Processing) - R
This is an ipynb file originally created by The Data Scientist Society(データサイエンティスト協会スキル定義委員) and translated from Japanese to English by DeepL. The reason I updated this file is to spread this practice, which is useful for everyone who wants to practice R, from beginners to advanced engineers. Since this data is created for Japanese, you may face language problems when practicing. But do not worry, it will not affect much.
Data Science 100 Knocks (Structured Data Processing) - R Part1 (Q1 to Q20)
This is an ipynb file originally created by The Data Scientist Society(データサイエンティスト協会スキル定義委員) and translated from Japanese to English by DeepL. The reason I updated this file is to spread this practice, which is useful for everyone who wants to practice R, from beginners to advanced engineers. Since this data is created for Japanese, you may face language problems when practicing. But do not worry, it will not affect much.
Data Science 100 Knocks (Structured Data Processing) - R Part2 (Q21 to Q40)
This is an ipynb file originally created by The Data Scientist Society(データサイエンティスト協会スキル定義委員) and translated from Japanese to English by DeepL. The reason I updated this file is to spread this practice, which is useful for everyone who wants to practice R, from beginners to advanced engineers. Since this data is created for Japanese, you may face language problems when practicing. But do not worry, it will not affect much.
Data Science 100 Knocks (Structured Data Processing) - R Part3 (Q41 to Q60)
This is an ipynb file originally created by The Data Scientist Society(データサイエンティスト協会スキル定義委員) and translated from Japanese to English by DeepL. The reason I updated this file is to spread this practice, which is useful for everyone who wants to practice R, from beginners to advanced engineers. Since this data is created for Japanese, you may face language problems when practicing. But do not worry, it will not affect much.
Data Science 100 Knocks (Structured Data Processing) - R Part4 (Q61 to Q80)
This is an ipynb file originally created by The Data Scientist Society(データサイエンティスト協会スキル定義委員) and translated from Japanese to English by DeepL. The reason I updated this file is to spread this practice, which is useful for everyone who wants to practice R, from beginners to advanced engineers. Since this data is created for Japanese, you may face language problems when practicing. But do not worry, it will not affect much.
Data Science 100 Knocks (Structured Data Processing) - R Part5 (Q81 to Q100)
This is an ipynb file originally created by The Data Scientist Society(データサイエンティスト協会スキル定義委員) and translated from Japanese to English by DeepL. The reason I updated this file is to spread this practice, which is useful for everyone who wants to practice R, from beginners to advanced engineers. Since this data is created for Japanese, you may face language problems when practicing. But do not worry, it will not affect much.
Data Science 100 Knocks (Structured Data Processing) - SQL
This is an ipynb file originally created by The Data Scientist Society(データサイエンティスト協会スキル定義委員) and translated from Japanese to English by DeepL. The reason I updated this file is to spread this practice, which is useful for everyone who wants to practice SQL, from beginners to advanced engineers. Since this data is created for Japanese, you may face language problems when practicing. But do not worry, it will not affect much.

 

Comment