Python Forum
Functions to get all latitudes given a list of listing_ids
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Functions to get all latitudes given a list of listing_ids
#2
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.

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!
Reply


Messages In This Thread
RE: Functions to get all latitudes given a list of listing_ids - by DeaD_EyE - Jun-14-2019, 12:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Functions returns content of dictionary as sorted list kyletremblay15 1 2,064 Nov-21-2019, 10:06 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020