Closed johnmyleswhite closed 11 years ago
I'm not sure I agree with this. Julia vectors are vertical to reinforce the ordering of matrices, I think. That's not important for us to reinforce. And from the point of view of interactive data analysis, wasting all of that space doesn't sound like a good idea. On Nov 30, 2012 7:05 PM, "John Myles White" notifications@github.com wrote:
At present DataVec's don't ever interact with DataMatrix's, so we haven't needed to be careful about the horizontal or vertical orientation of a DataVec. Our current show() method makes a DataVec look horizontal, but the structure should probably be vertical for consistency with Julia's standard vectors.
— Reply to this email directly or view it on GitHubhttps://github.com/HarlanH/DataFrames.jl/issues/89.
If DataVec's are horizontal, what direction does their transpose go in?
And if they're horizontal, why are they printed vertically inside of DataFrame's?
To me, direction for a DV is barely relevant. It's just an array. We can print it either way. But yes, a DF is vertical, because that's the standard for database table output, and because most useful DFs will have more rows than columns, so it looks better in that direction. For a DV, it looks better horizontally, I think. On Nov 30, 2012 7:25 PM, "John Myles White" notifications@github.com wrote:
If DataVec's are horizontal, what direction does their transpose go in?
And if they're horizontal, why are they printed vertically inside of DataFrame's?
— Reply to this email directly or view it on GitHubhttps://github.com/HarlanH/DataFrames.jl/issues/89#issuecomment-10909664.
Ok. I don't have very strong feelings on this, but do think that verticality will turn out to be a helpful mnemonic when we have DataArray's. Let's revisit this then.
Ok. On Nov 30, 2012 7:31 PM, "John Myles White" notifications@github.com wrote:
Ok. I don't have very strong feelings on this, but do think that verticality will turn out to be a helpful mnemonic when we have DataArray's. Let's revisit this then.
— Reply to this email directly or view it on GitHubhttps://github.com/HarlanH/DataFrames.jl/issues/89#issuecomment-10909787.
I rather feel like DataVecs should print like vectors. I know it seems like a waste of space, but I think it's right.
For me the following code (which now is in my branch of DataFrames) settles the case for why we should make DataVec's vertical:
{DataVec(squeeze(m[:,i])) for i = 1:size(m, 2)}
That prints something that looks like an array, but the real "array" is actually the transpose of what you see on the screen when you print DataVec's horizontally.
I feel somewhat strongly that making all vectorish things vertical seems like a good idea.
I just changed this on my branch and like how it looks.
I'm outvoted. :) And in OSS, actually writing code is 9/10ths of the law.
The tyranny of democracy wins again! Now that we've got basically functional DataMatrix objects, I think the visual consistency is going to be helpful. If we succeed at getting DataVec to inherit from AbstractVector we'll also inherit vertical printing by default.
At present DataVec's don't ever interact with DataMatrix's, so we haven't needed to be careful about the horizontal or vertical orientation of a DataVec. Our current
show()
method makes a DataVec look horizontal, but the structure should probably be vertical for consistency with Julia's standard vectors.