• 2024-07-17Bk1_Ch10_01
    Chapter10解剖一幅图Book_1《编程不难》|鸢尾花书:从加减乘除到机器学习代码来源:https://matplotlib.org/stable/gallery/showcase/anatomy.htmlimportmatplotlib.pyplotaspltimportnumpyasnpfrommatplotlib.patchesimportCirclefrommatplotlib.patheffectsi
  • 2024-04-07001_可视化_matplotlib
    1.解剖一副图importmatplotlib.pyplotaspltimportnumpyasnpfrommatplotlib.patchesimportCirclefrommatplotlib.patheffectsimportwithStrokefrommatplotlib.tickerimportAutoMinorLocator,MultipleLocatorroyal_blue=[0,20/256,82/256]np.random.se
  • 2024-02-05matplotlib annotate
    matplotlibannotate参考:matplotlibannotate在数据可视化中,常常需要在图表中添加标注,以便更清楚地表达数据的含义。Matplotlib库中的annotate()函数提供了一种简单的方法来添加标注。1.annotate()函数的基本语法annotate()函数的基本语法如下:annotate(text,xy,xytext,a
  • 2023-11-26django学习笔记06 查询
    查询库中某个字段的重复值并计数shufareadingcourse.objects.filter(lessonId=targetid[0]['id']).values('qtype').order_by().annotate(count=Count('qtype'))当数据库中有这样的数据,可以看到qtype会有不同类别,但是又会有重复,所以当查询时可以使用这种方式查询到有多少个LETTER
  • 2023-07-28【git, idea】 GIT 地址变了, idea 右键annotate变成了灰色
    背景如题,git地址变了,把地址改过来后,虽然可以继续gitpull,commit,push等操作。但是,idea右键的annotate却变成了灰色这个是正常的状态,是可以点击的。但不正常时,这个是不出现,或者是置灰的。解决方案把idea项目下面的iml文件全部删掉,再把项目重新导入就行递归
  • 2023-07-21【补充】根据年月对文章进行分组
    【补充】根据年月对文章进行分组【一】官方文档的参考写法Django官网提供的orm语法#django官网提供的一个orm语法fromdjango.db.models.functionsimportTruncMonth-官方提供fromdjango.db.models.functionsimportTruncMonthSales.ob
  • 2023-07-09R语言 ggplot函数中 annotate选项增加注释
     001、基础绘图ggplot(data=mtcars,aes(x=mpg,y=disp,color=factor(cyl)))+geom_point()##基础绘图 002、annotete在任意位置增加注释ggplot(data=mtcars,aes(x=mpg,y=disp,##在坐标,25,300处增加QQcolor=factor(cyl)))+geom_point
  • 2023-05-10django中aggregate()和annotate()区别
    在Django中,aggregate()和annotate()是两个常用的聚合函数。它们都可以用来对一组查询结果进行聚合操作,但它们的作用是有所不同的。aggregate()是用于聚合整个查询集的结果,通常用于返回一个值,例如计算查询集中所有结果的数量、平均值、最大值或最小值等。使用aggregate()
  • 2023-05-05djangoadmin后台搜索结果筛选自定义模版
    django-admin对搜索结果进行自定义统计,可参考代码如下:defchangelist_view(self,request,extra_context=None):#cur1_time=datetime.now()data_dict={}value=request.GET.get('q',"")bill_cycle=request.GET.get('bi
  • 2023-05-04【Python】orm 按日期分类
    1.Trunc#获取每个月count总数fromdjango.db.modelsimportSumfromdjango.db.models.functionsimportTruncmodels.NafpComplete.objects.filter().annotate(month=Trunc('point_time','month')).values('month').annotate(count=Sum('
  • 2023-04-19Django笔记九之model查询filter、exclude、annotate、order_by
    本文首发于公众号:Hunter后端原文链接:Django笔记九之model查询filter、exclude、annotate、order_by在接下来四五篇笔记中,将介绍model查询方法的各个细节,为我们的查询操作提供各种便利。本篇笔记将介绍惰性查找、filter、exclude、annotate等方法,目录如下:惰性查找filtere
  • 2023-04-17Django中TruncMonth截取日期使用方法,按月统计
    将原来的年月日按照月份来截取统计数据,具体参考如下官方示例:-官方提供fromdjango.db.models.functionsimportTruncMonthArticle.objects.annotate(month=TruncMonth('timestamp'))#Truncatetomonthandaddtoselectlist.values('month')#GroupBymonth.anno
  • 2023-04-14Chapter5 注解
    注解importmatplotlib.pyplotaspltimportnumpyasnpx=np.linspace(-3,3,50)y=2*x+1plt.figure(num=1,figsize=(8,5),)plt.plot(x,y,)ax=plt.gca()ax.spines['right'].set_color('none')ax.spines['top'].set_color('
  • 2023-01-10django F查询
    目录F查询使用F()避免竞争条件F()赋值在Model.save()之后持续存在F对时间加减与annotate一起使用F()F查询使用F()避免竞争条件F()可以通过以下方式提供性能优势
  • 2023-01-02Kubernetes(k8s) kubectl annotate常用命令
    kubectl在$HOME/.kube目录中查找一个名为config的配置文件。可以通过设置KUBECONFIG环境变量或设置--kubeconfig参数来指定其它kubeconfig文件。本文主要介绍K
  • 2022-12-02annotate和aggregate的区别
    一.基本区别aggregate:返回使用聚合函数后的字段和值。annotate:在原来模型字段的基础之上添加一个使用了聚合函数的字段二.使用方法classBook(models.Model):
  • 2022-11-23 django聚合查询与分组查询
    目录django聚合查询与分组查询例题聚合、分组查询Count()例子order_by()values()annotate()和values()的顺序分组加聚合django聚合查询与分组查询例题聚合、分组查
  • 2022-10-31fastadmin自定义button根据条件展示
    {field:'operate',title:__('Operate'),table:table,events:Table.api.events.operate,formatter:Table.api.formatter.operate,
  • 2022-09-30Django - annotate 计算某个字段值总和
     # annotateclassUser(models.Model):status=models.SmallIntegerField(verbose_name="status",default=1)jifen=models.IntegerField(verbose_name=
  • 2022-08-1817 Djaogo日期归档查询方式
    Django提供了一种方式:日期归档查询方式如果以后遇到,要用某年某月分组的话,那么可以使用Django提供的方式:#fromdjango.db.models.functionsimportTruncMonth,TruncDay