If the row index is intrinsically connected to and meaningful in relationship to the other columns, you should add it as a separate column. All arrays in Julia start indexing at 1, and data frames displays its "row" indices consistent with how it would index. Indexing arrays with Real numbers any differently is asking for trouble.
I'm definitely sympathetic to your request, and including meaningful axis information as an intrinsic part of an array is something I've thought a lot about. But if you'd like to work with data frames, these "axes" must be explicitly included in the table as columns (in the wide format). I've played around with allowing indexing with the values of the axis in a different package (AxisArrays), but it require homogenous arrays and is definitely not ready for general use yet. Matt On Monday, August 24, 2015 at 12:28:30 PM UTC-4, Robert Smith wrote: > > In my opinion, when you did `df[20:50,:]`, you constructed a new >> DataFrame, which had no longer anything to do with the original `df`. So >> you cannot expect it to know the original position in `df`. And when you >> print it, the row number (instead of index) is generated on the fly, just >> let you know which value is at which line of the output. >> >> I think what needed here is just a formatted `print()` for DataFrame, >> which can toggle the row number index. >> > > When I do `df[20:50,:]`, the result is a subset of the original DataFrame > `df`, so I should expect to keep track of the index in `df`. It doesn't > take much to see why that is useful (an index often refers to a person, > geographical entity, discrete period of time, etc). >
