Member-only story

Is Golang a Suitable Option for Data Science in the Future?

Start learning data science with go — but should you?

Bryan Dijkhuizen
3 min readNov 16, 2021
Photo by Radowan Nakif Rehan on Unsplash

Go is a statically typed language and not commonly used for Data Science such as Python or R. But it is worth trying. So let’s figure out how you can do Data Science in the Golang.

Requirements

You will need to have Go installed on your machine.

Getting Started

To get started, we create a new project, which is done as follows, you create a new file called main.go and you enter the following starter code:

package mainimport (
"fmt"
"log"
"os"
)
func main() {
}

And that’s all you need to get started. Let’s try to run it to see if we don’t get any errors with: go run main.go

Getting the Data

In most crash courses to learn Data Science in Python or R, we use the Iris dataset, and we will use it this time.

In Go, there is a default function for reading CSV files. We use the OS Module to do this. To read the CSV, we enter the following code into our main func() :

package mainimport (
"log"
"os"
)

--

--

Bryan Dijkhuizen
Bryan Dijkhuizen

Written by Bryan Dijkhuizen

Writing about the life of a neurodivergent creative in a neurotypical world. — https://bryandijkh.substack.com/

Responses (1)