Hello all, this is my first time here so apologies if something is missed or in the wrong place.
I have recently started to learn to code and I am struggling with writing a function that will allow me to get all the data from a column in a data set by calling a function with inputs of the data set and a column number. I am completely stuck and any help would be appreciated.
My function starts like this:
Thanks.
I have recently started to learn to code and I am struggling with writing a function that will allow me to get all the data from a column in a data set by calling a function with inputs of the data set and a column number. I am completely stuck and any help would be appreciated.
My function starts like this:
def get_column(data, col_num):I already have the data so that does not need to be imported and col_num is the input to which I would type, for example:
print(get_column(data, 5))and it would return the 4th column.
Thanks.