Python Forum
[solved] duplication in pandas
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] duplication in pandas
#1
Missed some white space again.

Hi, im new to Python and Pandas.
Im trying to drop duplicates from my dataframe but something is wrong.
Im using Streamlit, Pandas , Python 3.11.
I have duplication on USA states . not all of them but instead of 48 i have 65. I dont have Hawaii and Alaska so should be 48.
Ive tried to use drop_duplicates() command but used column not with a states but with a column containing unique numbers and it looks like no duplicates where found ( easiest way to go trough 700 records )
Basically it counts like two separate entities ( if i understand correctly )


PState     687 non-null    object  
Linke bellow shows Barc chart with duplication.
https://imgur.com/a/zLsP08K



Edit: P.s.
 PState = st.sidebar.multiselect(
    "Select Pick Up State:",
    options=df["PState"].unique(),
    default=df["PState"].unique()
)
Shows same as image i posted. 2x IL , 2x TX etc.
Thank You.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  (Solved) Converting Dollar Amount Str to Int with Pandas calvinsomething 3 3,833 Nov-19-2020, 01:31 PM
Last Post: calvinsomething

Forum Jump:

User Panel Messages

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