Lesson goal: Data science: Graph a CSV file of CO2 concentration

Previous: Dealing with a line of CSVs | Home | Next: Some challenges with CO2 concentration

Visualizing data is one of the most important aspects of data science. This makes it easy for you (or your boss!) to see trends in data, that would be hard to see in just a list of numbers. Visualizing likely means making a graph (or plot) out of some data. Let's make a plot of the CO$_2$ data here.

Since charts are made of rows of data, arrays will be a natural way of holding and presenting your data to the chart drawing function. Thus, our job is to get the numbers from the data file co2.csv into two arrays; one array for the $x$ or horizontal axis, and one array for the $y$ or vertical axis.

We'll send these two arrays to drawchart as described here:
drawchart(xdata,ydata,type)
Move the mouse over a dotted box for more information.

A chart will always appear at the very bottom of the browser window. You might have to scroll down to see it.

Now you try. Finish the code and make a graph of CO2 concentration over the years.

Type your code here:


See your results here: