小编Пав*_*кий的帖子

无法在“ $ year;”附近的。\ metro.pl第31行的列表分配中修改键/值哈希切片。

我是Perl的新手。我不明白为什么我不能为字符串中的哈希字段分配年份

   %currentBook{year}=$year; 
完整代码在这里。

use warnings;
use strict;
use Scalar::Util qw(looks_like_number);
use Time::localtime; 

my $maxYear = Time::localtime->year+1;
my $year = $maxYear;
my %currentBook = (name=>"firstCurrentBook",
    author=>"NO",
    place=>"NO",
    year=>0);
my %maxBook = %currentBook;
my %minBook = %currentBook;
print "Choose action\n1 - Input book\n2 - Print min max year\n3 = exit\n->";
my $cond = <STDIN>;
while ($cond  != 3)
{
    if ($cond == 1){
        print "\nInput book name: ";
        $currentBook{name} = <STDIN>;
        print "\nInput author surname and initials: ";
        $currentBook{author} = <STDIN>;
        print …
Run Code Online (Sandbox Code Playgroud)

perl

4
推荐指数
1
解决办法
1437
查看次数

如何从 matplotlib 图表中的饼图中删除任何内容?

我正在尝试使用 pandas 进行数据可视化。这是我的代码,其中 plt 是 Matplotlib。

\n\n
meets = results.groupby([\'Meet\']).size()\nmeets.dropna()\nplt.figure(figsize=(14,14))\nmeets.plot(kind=\'pie\',autopct=\'%.2f\',fontsize=20,title=\'\xd0\x9f\xd1\x80\xd0\xb8\xd1\x87\xd0\xb8\xd0\xbd\xd0\xb0 \xd0\xb7\xd0\xbd\xd0\xb0\xd0\xba\xd0\xbe\xd0\xbc\xd1\x81\xd1\x82\xd0\xb2\xd0\xb0 \xd1\x81 \xd0\x94\xd0\xbe\xd0\xba\xd1\x82\xd0\xbe\xd1\x80\xd0\xbe\xd0\xbc\',legend=True,labels=None)\nplt.show()\n
Run Code Online (Sandbox Code Playgroud)\n\n

通过这段代码,我得到了这个没有标签的饼图。\n在此输入图像描述\n如何去掉这个标签?

\n

python matplotlib pandas

1
推荐指数
1
解决办法
3254
查看次数

标签 统计

matplotlib ×1

pandas ×1

perl ×1

python ×1