Python Forum
TypeError: unhashable type: 'Series'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: unhashable type: 'Series'
#1
I get the TypeError: unhashable type: 'Series' when running the code. The dataset does have a column called 'Date' The code is below
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv("data.csv")
date = input("What date would you like to view? (dd/mm/yyyy)\nEnter:  ")
df1 = df.loc(df["Date"] == date)
print(df1)
However the line below works;
[df1 = (df.loc[df.Date == date])

Attached Files

Thumbnail(s)
   
Reply


Messages In This Thread
TypeError: unhashable type: 'Series' - by bongielondympofu - Mar-14-2024, 02:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [pandas] TypeError: list indices must be integers or slices, not str but type is int. cspower 4 974 Dec-30-2023, 09:38 AM
Last Post: Gribouillis
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,708 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  TypeError: 'Series' object cannot be interpreted as an integer evelynow 2 17,833 Sep-11-2019, 02:43 PM
Last Post: timmahoney
  Error Message: TypeError: unhashable type: 'set' twinpiques 4 19,217 May-22-2019, 02:31 PM
Last Post: twinpiques
  AUCPR of individual features using Random Forest (Error: unhashable Type) melissa 1 3,359 Jul-10-2017, 12:48 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

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