我是新手leaflet.js.有人可以帮我调试以下代码吗?我试图在屏幕上显示地图,但只有放大和缩小按钮显示在Google Chrome上,地图屏幕显示为空.
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
<style>
#mapid { height: 180px; }
</style>
</head>
<body>
<div id="mapid"></div>
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script>
<script>
var mymap = L.map('mapid').setView([51.505, -0.09], 13);
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我有一个数据框df_1,year其中有一列表示犯罪发生的时间。例如,df_1 是这样的:
location description Weapon Year
0 Howard Ave Auto theft Knife 2017
1 Craig Drive Burglary Gun 2014
2 King Ave Assault Hands 2017
Run Code Online (Sandbox Code Playgroud)
我需要创建一个数据框,其中包含 2012-2017 年的犯罪发生次数。
crime_year = pd.DataFrame(df_1.year.value_counts(), columns=["Year", "AggregateCrime"])
crime_yearindex = crime_year.sort_index(axis = 0, ascending=True)
crime_yearindex
Run Code Online (Sandbox Code Playgroud)
当我打印时crime_yearindex,我只得到列标题而不是数据本身。我可能做错了什么?