Jun-14-2019, 12:45 PM
What is your problem?
We have no information about input format, which can differ.
If the indices are all right and if there are no rows inside your dataset, which have lesser cols, then it should work.
You have to recognize, that indexing begins with 0.
If you don't know on which position is what, you could use enumerate.
We have no information about input format, which can differ.
If the indices are all right and if there are no rows inside your dataset, which have lesser cols, then it should work.
You have to recognize, that indexing begins with 0.
If you don't know on which position is what, you could use enumerate.
def get_one_row(airbnb_data): first_row = airbnb_data[0] # if airbnb is already a list with rows # if it's text, use the method splitlines on it and then take the first element. for idx, column in enumerate(first_row.split()): print(idx, column)Then you see [(0, "your_column 1"), (1, "your_column 2"), ...]
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!