Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6c8212b

Browse files
committed
dataframe数据读取
1 parent 09cc5d4 commit 6c8212b

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

猜数字/main.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,27 @@ def main():
115115
# main()
116116

117117
# 2.可视化
118-
show_res()
118+
# show_res()
119+
120+
import numpy as np
121+
122+
lis = [{
123+
"trading_date": "2020-05-14",
124+
"commodity_id": "I2009",
125+
"member_name": "永安期货",
126+
"rank": "1",
127+
"volume": "101219",
128+
"volume_change": "4148"
129+
},
130+
{"trading_date": "2020-05-14",
131+
"commodity_id": "I2009",
132+
"member_name": "xxxx",
133+
"rank": "1",
134+
"volume": "101219",
135+
"volume_change": "4148"}
136+
]
137+
138+
dataframe = pd.DataFrame(lis)
139+
line = dataframe[dataframe["member_name"] == "永安期货"]
140+
print(line["volume"].values[0])
141+
print(line["volume_change"].values[0])

0 commit comments

Comments
 (0)