我是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) 我正在尝试使用 pandas 进行数据可视化。这是我的代码,其中 plt 是 Matplotlib。
\n\nmeets = 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()\nRun Code Online (Sandbox Code Playgroud)\n\n\n