|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import pandas as pd
import numpy as np
df=pd.read_csv("./FIND1.csv",encoding="GB2312")
# print(df.head())
print(df.loc["2023/2/23"])
cvs 信息
FID CSDWMC CSDW RQ TZRQ
9CC9C04989534CB79F243D4BFA8DC84D N1测试队 8ac161b681a4f4a70181b28703680280 2023/2/23 2023/2/24
582DEA4962CA4979A02556705F457578 N1测试队 8ac161b681a4f4a70181b28703680280 2023/2/23 2023/2/24
54A8A175EED74653ACA2D1C65FC91D43 N1测试队 8ac161b681a4f4a70181b28703680280 2023/2/23 2023/2/24
6AC115D152A64F53A52D361365C0A83E N1测试队 8ac161b681a4f4a70181b28703680280 2023/2/23 2023/2/24
37355ED833C04FE3AE53625523B4F4F4 N1测试队 8ac161b681a4f4a70181b28703680280 2023/2/23 2023/2/24
0921E41F628C4F97846BA1ACB67C3DFA N1测试队 8ac161b681a4f4a70181b28703680280 2023/2/23 2023/2/24
F839AD055193484BAE881AEBB9EBC0B3 N1测试队 8ac161b681a4f4a70181b28703680280 2023/2/23 2023/2/24
1BCB5E85015F4735A7407002201B329F N1测试队 8ac161b681a4f4a70181b28703680280 2023/2/23 2023/2/24
FB45F88A251C40669837C2B95F908168 N1测试队 8ac161b681a4f4a70181b28703680280 2023/2/23 2023/2/24
A9401FB869214E70AD524777ECD8D451 N1测试队 8ac161b681a4f4a70181b28703680280 2023/2/23 2023/2/24
81A879EDF9134B7F98E0773DE29B7F0F N1测试队 8ac161b681a4f4a70181b28703680280 2023/2/23 2023/2/24
CE922EE0774A4EF9B6C1574228370066 N1测试队 8ac161b681a4f4a70181b28703680280 2023/2/23 2023/2/24
C:\Users\jcl\AppData\Local\Programs\Python\Python39\python.exe F:/untitled/1.py
Traceback (most recent call last):
File "F:\untitled\1.py", line 5, in <module>
print(df.loc["2023/2/23"])
File "C:\Users\jcl\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexing.py", line 1073, in __getitem__
return self._getitem_axis(maybe_callable, axis=axis)
File "C:\Users\jcl\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexing.py", line 1312, in _getitem_axis
return self._get_label(key, axis=axis)
File "C:\Users\jcl\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexing.py", line 1260, in _get_label
return self.obj.xs(label, axis=axis)
File "C:\Users\jcl\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\generic.py", line 4056, in xs
loc = index.get_loc(key)
File "C:\Users\jcl\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexes\range.py", line 395, in get_loc
raise KeyError(key)
KeyError: '2023/2/23'
Process finished with exit code 1
import pandas as pd
import numpy as np
df=pd.read_csv("./FIND1.csv",encoding="GB2312", sep="\s+")
# print(df.head())
print(df.loc[df["RQ"] == "2023/2/23"])
|
|