从变量中删除值

2024-04-30 06:59:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我是一名新的python学习者,对从变量中删除值有疑问

前11条数据记录如下所示:

Type Latitude Longitude 

Dog     41.9595 82.494997
Cat     41.4388 82.493585
Other   41.5238 82.482829
Bird    41.3848 82.493739
Lizard  41.3838 82.383883
Lizard  41.7238 82.293848
Other   41.7483 82.283848
Other   41.2747 82.474484
Dog     41.3838 82.393949
Cat     41.3883 82.373848
Bird    41.3828 82.383838

因此,我使用

import pandas as pd
Pet_Data = pd.read_csv('PetMap.csv',sep=',')
Pet_Data.head()

我已经做了一个互动点地图在博克使用

TOOLTIPS = [("type", "@Type"),       # this accesses 'Type' column
        ("lat", "@Latitude"),    # this accesses 'Latitude' column
        ("lat", "@Longitude")]   # this accesses 'Longitude' column

p = figure(tooltips=TOOLTIPS)        # initiate your figure and add TOOLTIP


p.circle(x='Latitude',               # circles on x
     y='Longitude',                and on y
     source=Pet_Data             # points to Pet_data df
     size=40)                    # simple circle size argument

show(p)

所以我的问题是如何从类型变量中删除“其他”数据记录,因为我不希望这些记录显示在我的地图上


Tags: 数据datatype记录columnthiscatother