我正在使用传单.是否有人建议使用能够返回用户点击的所有图层的所有功能的功能?
例如,我有一个点图层和一个多边形图层.当用户点击某个点时,我想在该点下方显示该点和多边形的属性.如果用户仅单击多边形,则它应仅显示多边形的属性.
提前感谢您提供的任何帮助.
我的csv如下(MQM Q.csv):
Date-Time,Value,Grade,Approval,Interpolation Code
31/08/2012 12:15:00,,41,1,1
31/08/2012 12:30:00,,41,1,1
31/08/2012 12:45:00,,41,1,1
31/08/2012 13:00:00,,41,1,1
31/08/2012 13:15:00,,41,1,1
31/08/2012 13:30:00,,41,1,1
31/08/2012 13:45:00,,41,1,1
31/08/2012 14:00:00,,41,1,1
31/08/2012 14:15:00,,41,1,1
Run Code Online (Sandbox Code Playgroud)
前几行没有"值"条目,但它们稍后开始.
这是我的代码:
import pandas as pd
from StringIO import StringIO
Q = pd.read_csv(StringIO("""/cygdrive/c/temp/MQM Q.csv"""), header=0, usecols=["Date-Time", "Value"], parse_dates=True, dayfirst=True, index_col=0)
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Traceback (most recent call last):
File "daily.py", line 4, in <module>
Q = pd.read_csv(StringIO("""/cygdrive/c/temp/MQM Q.csv"""), header=0, usecols=["Date-Time", "Value"], parse_dates=True, dayfirst=True, index_col=0)
File "/usr/lib/python2.7/site-packages/pandas-0.14.0-py2.7-cygwin-1.7.30-x86_64.egg/pandas/io/parsers.py", line 443, in parser_f
return _read(filepath_or_buffer, kwds)
File "/usr/lib/python2.7/site-packages/pandas-0.14.0-py2.7-cygwin-1.7.30-x86_64.egg/pandas/io/parsers.py", line 228, in _read
parser …Run Code Online (Sandbox Code Playgroud) 我正在使用烧瓶,并且具有以下结构
<root>
manage_server.py
cas <directory>
--- __init__.py
--- routes.py
--- models.py
--- templates <directory>
--- static <directory>
--- formmodules <directory>
------ __init__.py
------ BaseFormModule.py
------ Interview.py
Run Code Online (Sandbox Code Playgroud)
在routes.py中,我试图在Interview模块中创建Interview类的实例,如下所示
my_module = "Interview"
module = importlib.import_module('formmodules."+my_module)
Run Code Online (Sandbox Code Playgroud)
我在这里看到一个错误
ImportError: No module named formmodules.Interview
Run Code Online (Sandbox Code Playgroud)
有关初始化文件的一些信息:
/cas/formmodules/__init__.py is empty
/cas/__init__.py is where I initialize my flask app.
Run Code Online (Sandbox Code Playgroud)
让我知道了解这些文件中的任何内容是否有帮助。
我有一个类别树,如下所示。
import pandas as pd
asset_tree = [
{'id': 1, 'name': 'Linear Asset', 'parent_id': -1},
{'id': 2, 'name': 'Lateral', 'parent_id': 1},
{'id': 3, 'name': 'Main', 'parent_id': 1},
{'id': 4, 'name': 'Point Asset', 'parent_id': -1},
{'id': 5, 'name': 'Fountain', 'parent_id': 4},
{'id': 6, 'name': 'Hydrant', 'parent_id': 4}
]
tree = pd.DataFrame(asset_tree)
print(tree)
Run Code Online (Sandbox Code Playgroud)
这给了我一个数据框,如下所示:
id name parent_id
0 1 Linear Asset -1
1 2 Lateral 1
2 3 Main 1
3 4 Point Asset -1
4 5 Fountain 4
5 6 Hydrant …Run Code Online (Sandbox Code Playgroud)