How to determine how many variables and what kind of variables a table of data has? Here's an example regarding what I'm lost on. In the past I've just found myself counting columns to determine how many variables a table has, but I've realized that's totally insufficient.
For example, I look at the following table and would think: That has three variables because there are three columns. There are two categorical variables, Season and Type, and one numerical variable, Dollars.
    ['Season',  'Type',     'Dollars'],
    ['Winter',  'Sales',     1000],
    ['Winter',  'Expenses',  400],
    ['Winter',  'Profit',    250],
    ['Spring',  'Sales',     1170],
    ['Spring',  'Expenses',  460],
    ['Spring',  'Profit',    250],
    ['Summer',  'Sales',     660],
    ['Summer',  'Expenses',  1120],
    ['Summer',  'Profit',    300],
    ['Fall',    'Sales',     1030],
    ['Fall',    'Expenses',  540],
    ['Fall',    'Profit',    350]

However, I could then look at the following table, containing exactly the same information, and think: That has four variables because there are four columns: one categorical variable, Season, and three numerical variables, Sales, Expenses and Profit.
    ['Season',  'Sales', 'Expenses', 'Profit'], 
    ['Winter',  1000,    400,        200],
    ['Spring',  1170,    460,        250],
    ['Summer',  660,     1120,       300],
    ['Fall',    1030,    540,        350]

So what's true? And what is the correct method to determine how many, and what kind of variables a set of data has? Is there a proper way to structure the data to give the "right" answer?
 A: There's most likely no single correct answer to the question "how many variables does this dataset have", one can structure the data in different ways as you've shown leading to different numbers of columns.
However, there's probably a good answer to "what structure would make this dataset most amenable for analysis", and that would probably be the first version you presented.
Hadley Wickham has done a bit of writing about this on what he calls "tidy data" (see this paper). When a dataset is tidy it's in its most ably-analyzed form. Ie. it's in its most basic form for an easy and consistent way for transformations to be applied on top, so that further analysis can be done. He argues that the best ways to structure a dataset for analysis are when:

  
*
  
*Each variable forms a column.
  
*Each observation forms a row.
  
*Each type of observational unit forms a table.
  

The first dataset you presented, the one with 3 columns, would fit as tidy under these guidelines.
He also outlines 5 common ways datasets get untidy:

  
*
  
*Column headers are values, not variable names.
  
*Multiple variables are stored in one column.
  
*Variables are stored in both rows and columns.
  
*Multiple types of observational units are stored in the same table.
  
*A single observational unit is stored in multiple tables.
  

The second version of your dataset, which has four columns, exhibits issue #1. This can be seen through Section 3.1 of his paper where he refers to the dataset about religion and income.
Again, there's probably no "correct" answer to the question of how many variables does this dataset have, but to the question how many columns should this dataset have, the right answer would be 3. Tidy data makes it easy and provides a consistent way to perform additional transformation to a dataset to get it into whatever future form is needed for analysis. Eg. Your second dataset with 4 columns is easily created with a Pandas group_by or an R aggregate from the first dataset.
