I have a dataframe which has some column like below which contains arrays of different sizes:
array_column
["a","b","c","d"]
["d","e","f"]
["h","i","j","k","l"]
["m","n","o","p"]
["q","r","s"]
I want to select set of array elements from each cell starting from index =1 till index = (whatever is the array length of that cell -1) and then convert the array into string in which array elements are joined using '/'
So expected output column after selecting required elements will look like :
array_column
["b","c"]
["e"]
["i","j","k"]
["n","o"]
["r"]
final_ouput_column
"b/c"
"e"
"i/j/k"
"n/o"
"r"
If it's a simple array for eg which is not a dataframe i would do something like below:
array = ["a","b","c","d","e","f"]
new_array = array[1:len(array)-1] // I dont know what should be done //for len(array)-1 for dataframe
print(new_array) . [output is "b","c","d","e"]
print('/'.join(new_array)) "b/c/d/e"