Python Forum
Pandas Indexing with duplicates
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pandas Indexing with duplicates
#1
Hello guys,first time on this forum.

I am working in geomatic processes automation and I have a little question regarding pandas.
I am currently working with a pd.dataframe indexed by street names. The same street name is present several times in my dataframe index.
I am looking for a way to get values based on the index (ex:'WashingtonStreet'). I would like the pandas to return all the rows indexed
with this particular string. Right now, all I am able to get is the first encounter of that index as a returned row :


print(sub_df.loc['RangSaint_Joseph'])

My dataframe structure looks like this :
Index : Street names
FID
X coordinate
Y coordinate
Bearing
Street names

Thanks, and if you have comments on how to improve my thread, feel free.

M.C
Reply


Messages In This Thread
Pandas Indexing with duplicates - by energerecontractuel - Mar-05-2019, 08:56 PM
RE: Pandas Indexing with duplicates - by scidam - Mar-05-2019, 11:44 PM
RE: Pandas Indexing with duplicates - by scidam - Mar-07-2019, 12:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Add group number for duplicates atomxkai 2 1,190 Dec-08-2022, 06:08 AM
Last Post: atomxkai
  Convert indexing For Loop from MATLAB (uses numpy and pandas) bentaz 3 4,256 Mar-20-2018, 08:29 PM
Last Post: bentaz
  jupyter pandas remove duplicates help okl 3 7,594 Feb-25-2018, 01:11 PM
Last Post: glidecode

Forum Jump:

User Panel Messages

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