[英]How do I only look at certain rows in pandas dataframe?
I want to only look at the information of rows that correspond with 'U' and 'L' and 'R' under the category 'LU'. 我只想查看类别“ LU”下与“ U”,“ L”和“ R”相对应的行的信息。 What exactly do I have to write to grab that specific data?
我到底要写什么才能获取特定数据?
PTYPE LU
1 E
2 U
3 R
4 L
5 R
test = data[data['LU'] == 'U' | 测试=数据[数据['LU'] =='U'| 'L' |
'L'| 'R' ]
'R']
I thought it might be the following statement above, but I got an error. 我以为可能是上面的以下陈述,但出现错误。 'U' 'L' and 'R' are also not integers.
“ U”,“ L”和“ R”也不是整数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.