In [ ]:
require 'torch'
require 'Dataframe'
In [ ]:
my_data = Dataframe('../../data/realistic_29_row_data.csv')
In [ ]:
my_data:head(2):output()
my_data:tail(2):output()
In [ ]:
my_data:where('Gender', 'Male'):head(2):output()
More flexible searching is allowed through custom search functions
In [ ]:
my_data:where(function(row) return row.Gender == "Male" and row.Weight > 70 end):output()
In [ ]:
my_data:
update(
function(row) return row.Weight > 88 end,
function(row)
row.Weight = 88
return row
end)
my_data:
where(function(row) return row.Gender == "Male" and row.Weight > 70 end):
output()
In [ ]:
my_data:
set{item_to_find = 55.5,
column_name = 'Weight',
new_value = Df_Dict({Gender = "Female"})}
my_data:
where(function(row) return row.Gender == "Female" and row.Weight < 60 end):
output()
In [ ]: