Home > other >  Solve the problem of coding: AttributeError: 'STR' object has no attribute 'sheets�
Solve the problem of coding: AttributeError: 'STR' object has no attribute 'sheets�

Time:02-08

Mport folium
The from folium import plugins
The from folium. The features import GeoJson
The import pandas as pd
The import CSV

Filename="/Users/wwweiyue/Documents/python/DATABASE/country_wise_latest CSV"
With the open (filename, the 'r', encoding="utf-8") as f:
Read=CSV. Reader (f)
Ndata []=https://bbs.csdn.net/topics/
Mdata []=https://bbs.csdn.net/topics/
For the index, the info in enumerate (read) :
[5] Ndata=https://bbs.csdn.net/topics/info
Mdata=HTTP://https://bbs.csdn.net/topics/info/14:
='https://bbs.csdn.net/topics/,' final_data. Join (Ndata) + ', '. Join (Mdata)
Ndata. Append (Ndata)
Mdata. Append (Mdata)

M=folium Map (
Location=[43.52902984, 12.16218376],
Zoom_start=2,
Min_zoom=2,
Max_zoom=10,
Tiles="OpenStreetMap"
)

Data=https://bbs.csdn.net/topics/final_data
Table=data sheets () [0]
For I in range (table. Nrows - 2) :
Templist=table. Row_values (I + 2)
Popup='& lt; B> '+ templist [0]. Upper ()
Popup +='& lt;/br> Confirmed: "+ STR (int (templist [1]))
Try: popup +='& lt;/br> Will appear: "+ STR (int (templist [2]))
Except: popup +='& lt;/br> Will appear: "+ STR (templist [2])
Try: popup +='& lt;/br> Recovered: "+ STR (int (templist [3]))
Except: popup +='& lt;/br> Reovered: "+ STR (templist [3])
Try: popup +='& lt;/br> Active: "+ STR (int (templist [4]))
Except: popup +='& lt;/br> The Active '+ STR (templist [4])

The radius=classifyRadius (temlist [1])

Folium. CircleMarker (
Location=[templist [16], templist [15]],
Popup=folium. Popup (popup, max_width=200),
The radius=radius,
Tooltip='click to know more,
Color='transparent',
The fill=True,
Fill_color='# 8 b0000'
). Add_to (m)

Del templist popup, the radius

Margaret spellings ave (' Region_Confirmed. HTML)
Del data, table
Print (" finished ")

CodePudding user response:

Excuse me, how to solve,,,
  • Related