DataFrame icon indicating copy to clipboard operation
DataFrame copied to clipboard

DataFrame addRow does not consider key order

Open AtharvaKhare opened this issue 6 years ago • 0 comments

df := DataFrame
	withRows: #(
		('A1' 'B1' 'D1' 'C1')
		('A2' 'B2' 'D2' 'C2'))
	columnNames: #('A' 'B' 'D' 'C').
	
ds := DataSeries
	withKeys: #('A' 'B' 'C' 'D')
	values: #('A3' 'B3' 'C3' 'D3')
	name: 3.
	
df addRow: ds.

Inspecting df gives us: wrong_dataframe

Rotating ds's keys does not affect output

ds := DataSeries
	withKeys: #('D' 'C' 'B' 'A')
	values: #('D3' 'C3' 'B3' 'A3')
	name: 3.
	
df addRow: ds.
wrong_dataframe

DataFrame addRow: should rearrange ds's ~~keys~~ values according to keys before adding them into the DataFrameInternal

AtharvaKhare avatar Jun 21 '19 12:06 AtharvaKhare