Reading CSV data from the internet
Often, you need to fetch data in CSV format from the internet. In this recipe, you will discover a simple way of fetching such data and reading it into DataFrame
using the CSV.jl
package. Then, we will look at how you can save this data back to a CSV file.
Getting ready
We will use a classic dataset calledIris, which is available for download here: https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data.
The citation is as follows:
@misc{R.A. Fisher , author = "R.A. Fisher ", year = "2017", title = "{UCI} Machine Learning Repository", url = "http://archive.ics.uci.edu/ml", institution = "University of California, Irvine, School of Information and Computer Sciences" }
Start your Julia command line and make sure that you do not have a file namediris.csv
in your working directory. Also, make sure that you have theDataFrames.jl
and theCSV.jl
packages installed. If they are missing, then install them by running the commands using Pkg; Pkg.add("DataFrames...