Press "Enter" to skip to content

Day: November 22, 2023

Practical Applications of Functional Programming Techniques in R

Anirban Shaw continues a series on functional programming:

Functional programming in R is more than just a trendy buzzword; it’s a powerful approach that can dramatically simplify and enhance your data analysis tasks. In this section, we’ll explore real-world examples of common data analysis problems solved using functional programming in R, comparing them to traditional imperative methods. We’ll also highlight the conciseness and readability of functional code, demonstrating why it’s a game-changer for data professionals.

I think there’s a lot of value in understanding the functional programming approach for a few reasons:

  1. Functional programming makes more intuitive sense to data platform developers who are raised on “set-based” operations and thinking over columns rather than rows.
  2. Functional programming allows for ease of parallel computation. This is why Spark heavily emphasizes functional programming and why the code base itself is written in a functional programming language.
  3. Functional code is often terser than equivalent imperative code.
  4. Functional code allows you to build more “bottom-up,” starting with small functions and composing them rather than thinking in a “top-down” approach of classes and interactions between classes. For people who are not full-time application developers, the ease of writing a quick function is huge, which is part of why shell scripting languages like Powershell and Bash emphasize this approach as well.

H/T R-Bloggers.

Comments closed

Exponential Regression in R

Steven Sanderson understands the power of compound interest:

Before we jump into the code, let’s quickly grasp the concept of exponential regression. In simple terms, it’s a statistical method used to model relationships where the rate of change of a variable is proportional to its current state. Think of scenarios like population growth, viral spread, or even financial investments.

Read on to see how you can perform a regression in this kind of scenario.

Comments closed

Azure Database for MySQL Flex Server and Power BI

Denny Cherry dips a toe into unfamiliar waters:

Recently, I upgraded our core Azure SQL Database for MySQL Single Server to Azure SQL Database for MySQL Flex Server. The migration was pretty straight forward and I simply did an export with mysqldump and then an import with MySQL. The problem came up when I tried to use Power BI (PBI) and connect to to the Azure SQL Database for MySQL Flex Server instead. When I tried to connect PBI to the Flex server I kept getting “The given key was not present in the dictionary”.

Read on to see what Denny did to resolve the issue.

Comments closed

Starting a Free Trial of Microsoft Fabric

Andy Leonard kicks off a trial:

Are you interested in learning more about Microsoft Fabric?

One way to begin tinkering with the new platform is to start a free trial. At the time of this post, a free trial is available here:

Read on for instructions on how to try Fabric out. Now that Fabric is in GA, you’ll have to pay once the trial is over, but this does at least give you some time to check it out before then.

Comments closed

Flat File Importation via Azure Data Studio

Josephine Bush needs to import a file:

Initially, I thought I would have to use sqlcmd because I’m on a Mac and don’t have SSMS. It turns out Azure Data Studio has a nifty way to import data from flat files – yay!

I’ve used this extension a few times in the past on Linux and Windows and it’s pretty good, especially if you have a fairly straightforward flat file. If it’s a messy file, you’ll still get inscrutable errors. And, as far as data sources go, GIGO.

Comments closed

Computing Accurate Percentages in Power BI with Row-Level Security

Marco Russo and Alberto Ferrari don’t want to let any information slip out:

Let us start with a simple challenge: we want to show the percentage of sales in Europe, compared to the sales made to all customers worldwide. It is a relatively trivial question, the kind of DAX code you learn at the beginning of your Power BI career, and it can be solved with a simple measure:

But what happens when the model includes security roles? Well, that’s what you’ll have to read on to learn.

Comments closed

Visualizing JSON Files in Fabric Notebooks

Sandeep Pawar wants readability:

JSON is ubiquitous, particularly when working with APIs and logs. Its unstructured nature makes it highly flexible for handling anything from a simple array to a complex nested structure. However, this can also make it challenging for data analysis. When parsing JSON, it’s crucial to understand its structure so you can flatten it and convert it into a tabular format for analysis. Once the structure is identified, you can use pandas or PySpark to explode or normalize it into the desired shape. In this article, I will explain the method I use. While this approach is applicable to any notebook, there is a specific trick to make it work in a Fabric notebook.

Read on for that trick.

Comments closed