我安装了anaconda(版本:conda 4.2.9,python3),import cv2当我收到以下错误时我正在尝试做:
ImportError: No module named 'cv2'
随conda search cv2我得到这个:
opencv 2.4.2 np15py26_0默认值
2.4.2 np15py27_0默认值
2.4.2 np16py26_0默认值
2.4.2 np16py27_0默认值
2.4.2 np17py26_0默认值
2.4.2 np17py27_0默认值
2.4.2 np15py26_1默认值
2.4.2 np15py27_1默认值
2.4.2 np16py26_1默认值
2.4.2 np16py27_1默认值
2.4.2 np17py26_1默认值
2.4.2 np17py27_1默认值
2.4.6 np16py26_0默认值
2.4.6 np16py27_0默认值
2.4.6 np17py26_0默认值
2.4.6 np17py27_0默认值
2.4.6 np18py26_0默认值
2.4.6 np18py27_0默认值
2.4.9 np18py27_0默认值
2.4.10 np19py26_0默认值
2.4.10 np19py27_0默认值
2.4.10 np110py27_1默认值
2.4.10 np19py26_1默认值
2.4.10 np19py27_1默认值
为了能够导入cv2模块,我需要做什么?谢谢!
PS:我使用的是Ubuntu 16.04
我试图找出 PIL 中可以使用font = ImageFont.load()and/orImageFont.truetype()函数使用哪些字体。我想创建一个列表,可以从中采样要使用的随机字体。不幸的是,到目前为止我还没有在文档中找到任何内容。
我有一个包含三列的数据框Features, CV-fold, Accuracy, Network。我想为每个网络绘制一个箱线图,按轴的特征和 CV 折叠进行分组(参见示例图像)。
df = pd.read_csv(path)
df['Features'] = df["Features"].astype('category')
ordered_features = sorted(df.Network.value_counts().index)
df = df.loc[df['Accuracy'] > 0.1]
df.Accuracy = df.Accuracy*100
#sns.color_palette("husl", len(df['CV-fold'].value_counts().index))
#sns.set_palette('husl', len(df['CV-fold'].value_counts().index))
g = sns.FacetGrid(df, row="Network", row_order=ordered_features,
height=3, aspect=3, legend_out=True, despine=False)
g.map(sns.boxplot, x="CV-fold", y="Accuracy", hue="Features", data=df, palette='muted').add_legend()
g.set_axis_labels("", "Accuracy (%)")
Run Code Online (Sandbox Code Playgroud)
因为我有 8 个不同的网络,所以我不想将它们全部放在一列或一行中,而是将其格式化为网格(例如 2x4)。此外,即使sharex未启用,x 轴也仅标记在图表的最底部。
我怎样才能做到这一点?
当我编译我的C++项目时,我得到一个我不明白的错误.我的错误在以下代码部分中引发:
void twogramsToFile(const map <string,int> twogram, const string outputfile) {
ofstream myfile (outputfile);
for (auto &x : twogram) {
outputfile << x.first << " " << x.second << "\n"; //this line causes the error
}
myfile.close();
}
Run Code Online (Sandbox Code Playgroud)
我得到的错误信息是这个:
no match for ‘operator<<’ (operand types are ‘const string {aka const std::__cxx11::basic_string<char>}’ and ‘const std::__cxx11::basic_string<char>’)
Run Code Online (Sandbox Code Playgroud)
我认为<<运算符是为内置类型定义的.