Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pandas Help
#7
# The Mojave Desert states
canu = ["California", "Arizona", "Nevada", "Utah"]
import pandas as pd
# Filter for rows in the Mojave Desert states
mojave_homelessness = homelessness['state'["California", "Arizona", "Nevada", "Utah"]].isin(canu)
# See the result
print(mojave_homelessness)
Error:
(Track Back Most Recent Call Last) File "<stdin>", Line 5, in <module> mojave_homelessness = homelessness['state'["California", "Arizona", "Nevada", "Utah"]].isin(canu) Type Error: String indices must be integers
I am trying to : Filter homelessness for cases where the USA census state is in the list of Mojave states, canu, assigning to mojave_homelessness


Thank you for the attention. Learning the language and the methods for using this site. Thanks again...
Reply


Messages In This Thread
Python help... - by cliffordhubbard - Apr-24-2020, 07:12 PM
RE: Pandas Help - by micseydel - Apr-27-2020, 10:54 PM
RE: Pandas Help - by mirai - Jun-05-2020, 05:16 AM
RE: Python help... - by brianwoong - Dec-05-2020, 06:33 AM
RE: Python help... - by Jeff900 - Apr-24-2020, 07:36 PM
RE: Python help... - by cliffordhubbard - Apr-24-2020, 08:37 PM
RE: Python help... - by Jeff900 - Apr-24-2020, 08:48 PM
RE: Python help... - by deanhystad - Apr-24-2020, 09:28 PM
RE: Python help... - by cliffordhubbard - Apr-27-2020, 12:15 PM
Pandas Help - by cliffordhubbard - Apr-27-2020, 07:02 PM

Forum Jump:

User Panel Messages

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