我正在关注本教程https://www.kaggle.com/residentmario/univariate-plotting-with-pandas 并尝试执行 pokemon 数据库中提到的练习,但是每当我尝试实现下面的代码时,我都会收到下面提到的错误并且不明白该怎么做。我正在使用 matplotlib.use('agg') 因为我收到了一个与 Tkinter 相关的错误。我正在使用 pycharm、python 3.6 和 ubuntu 18.04
这是我的代码:
import pandas as pd
import matplotlib
matplotlib.use('agg')
from matplotlib.pyplot import plot
df=pd.read_csv("/home/mv/PycharmProjects/visualization/pokemon.csv")
df['type1'].value_counts.plot(kind='bar')
Run Code Online (Sandbox Code Playgroud)
错误
Traceback (most recent call last):
File "/home/mv/PycharmProjects/visualization/univariate plotting.py",
line 9, in <module>
df['type1'].value_counts.plot(kind='bar')
AttributeError: 'function' object has no attribute 'plot'
Run Code Online (Sandbox Code Playgroud) 我在想是否有可能在 C++ 中创建一个包含数据的字符串,我不想创建一个字符串字符串或一个字符串数组。
假设我有一个字符串mv:
mv =
"hello
new
world "
Run Code Online (Sandbox Code Playgroud)
“你好”、“新”和“世界”在不同的行中。现在,如果我们打印mv,那么“hello”、“new”和“world”应该出现在不同的行上。
我也在考虑竞争性编程。如果我将查询的所有答案连接在一个字符串中,然后将答案或cout所有查询一一输出,那么这两个输出是否会有时间差?
我使用sequelize作为mysql数据库的orm,现在我面临的问题是,在运行我的node.jsexpress应用程序超过4或5次后,我收到此错误“指定的键太多;允许最多 64 个键”,现在我想知道是什么原因导致出现此错误,有人可以告诉我解决此问题的解决方案吗?到目前为止,我通过将 'alter: true' 替换为 'force: true' 来解决此问题,因为其中我必须再次创建数据库,我想知道是否有更好的方法来解决这个问题并提供一些有关 {alter: true} 如何工作的见解
const Sequelize =require('sequelize');
const DataTypes= Sequelize.DataTypes;
const config= require('../../config.json');
const db = new Sequelize(
config.db.name,
config.db.user,
config.db.password
,{
dialect:'mysql'
});
const categorie = db.define('categorie',{
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
name:{
type:DataTypes.STRING,
unique:true,
} ,
tax:{
type: DataTypes.FLOAT,
}
});
const product =db.define('product',{
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
name:{
type:DataTypes.STRING,
alownull:true,
unique:false
},
vendor:{
type:DataTypes.STRING,
unique:false,
alownull:true,
},
price:{
type:DataTypes.INTEGER,
} …Run Code Online (Sandbox Code Playgroud)c++11 ×1
express ×1
matplotlib ×1
mysql ×1
node.js ×1
pandas ×1
python ×1
sequelize.js ×1
string ×1