Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
242 views
in Technique[技术] by (71.8m points)

python - Type error when trying to visualize a sqlite3 query

I get this error

TypeError: object of type 'sqlite3.Cursor' has no len()

when trying to visualize a sqlite3 query in Seaborn. I am using Python 3.

#query that outputs 'Contintent', 'Year', 'Avgtemperature'
temp_increase_continents = c.execute("""
                                     SELECT Region, Year, AVG(Avgtemperature)
                                     FROM city_temperature
                                     GROUP BY Year
                                     ORDER BY Region
                                     """)
c.fetchall

#lineplot for above query
sns.lineplot(data=temp_increase_continents)
plt.show()

conn.commit()
conn.close()

Output should be a lineplot of the given query's result.

question from:https://stackoverflow.com/questions/65881025/type-error-when-trying-to-visualize-a-sqlite3-query

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...