Member-only story
Is Golang a Suitable Option for Data Science in the Future?
Start learning data science with go — but should you?
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"
)