Results 1 to 2 of 2

Thread: to group successive datasets using pandas in python

  1. #1
    Join Date
    Apr 2011
    Beans
    9

    to group successive datasets using pandas in python

    hello. I have a huge GPS datasets of the form (id,timestamp,longitude,latitude). Something like this
    id timestamp longitude latitude
    3 2001-02-02 13:02:01 132.3245 56.2345
    3 2001-02-02 13:02:06 132.3245 56.2345
    3 ......... same as above same as above
    .... .... ....
    3 2001-02-02 13:05:01 132.3245 56.2345
    3 2001-02-02 13:05:06 132.3246 56.2345
    the above is just an example of how my data is present. I have around 990000 records roughly. now i want something like this
    id timestamp longitude latitude
    3 2001-02-02 13:02:01 - 2001-02-02 13:05:01 132.3245 56.2345
    3 2001-02-02 13:05:06 132.3246 56.2345
    i want to merge all the rows of same latitude and longitude values into a single row. I am a beginner in pandas and i cannot use "group by" function where group by groups all the occurances but i want successive occurances to be grouped.

    any help would be surely appreciated.
    thank you very much..
    Last edited by madhu91; March 10th, 2013 at 05:35 AM.

  2. #2
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: to group successive datasets using pandas in python

    Thread moved to Programming Talk, at request of OP.
    Ubuntu 20.04 Desktop Guide - Ubuntu 22.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags

    Member: Not Canonical Team

    If you need help with your forum account, such as SSO login issues, username changes, etc, the correct place to contact an admin is here. Please do not PM me about these matters unless you have been asked to - unsolicited PMs concerning forum accounts will be ignored.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •