To delete a column of a dataframe (let's say df
) in javascript, you can first convert the dataframe into an array of arrays using the map
method of the dataframe. Then, you can iterate over each row of the array and remove the element from the corresponding index using the splice
method.
Here is the code that shows how to delete a column of a dataframe in javascript:
352 chars20 lines
This will output the modified array of arrays without the column at the specified index. Note that this method modifies the original array, so make a copy of the dataframe if you want to preserve the original.
gistlibby LogSnag