首页 > 其他分享 >module 'numpy' has no attribute 'int'.

module 'numpy' has no attribute 'int'.

时间:2023-05-09 15:33:28浏览次数:40  
标签:use int attribute module np numpy

原因:np.int 在 NumPy 1.20 中已弃用,在 NumPy 1.24 中已删除

AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:

image

解决方案

将np.int更改为np.int_
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
image
点击出现错误代码链接会自动跳转到相应numpy.int的位置
image

image
再次运行
image

标签:use,int,attribute,module,np,numpy
From: https://www.cnblogs.com/vipsoft/p/17385169.html

相关文章

  • mybatis @Intercepts @Signature
      详细介绍点击这里 @Intercepts是mybatis中的一个常用拦截器注解,表明当前对象是一个拦截器。@Intercepts//描述:标志该类是一个拦截器@Signature//描述:指明该拦截器需要拦截哪一个接口的哪一个方法type;//四种类型接口中的某一个接口,如Executor.class;......
  • Lenovo m93 mini 电脑 Hackintosh 黑苹果efi引导文件
    原文来源于黑果魏叔官网,转载需注明出处。(下载请直接百度黑果魏叔)硬件型号驱动情况主板Lenovom93mini处理器[email protected](35w)4-core/4-thread已驱动内存8GB(2x4)DDR31600MHz已驱动硬盘2.5"SSDSamsung860EVO500GB已驱动显卡IntelHDGraphics4000已驱动声......
  • Java NullPointerException 没有打印堆栈
    ref  https://www.bbsmax.com/A/obzbgx41JE/ 周五在公司搭好的ELK上查看日志,组长让看看其中NullPointerException出现很多的原因。通过NullPointerException搜索,点看其中一个查看,发现异常的信息就一行java.lang.NullPointerException,并没有堆栈信息。看了几个都没有,然后翻......
  • java.lang.NullPointerException解决方案,以及发生的原因。
    其实解决方案,倒是挺简单的,eclipse的console里,报错的地方点一下,就知道在哪一行了。真正要注意的是怎么避免这种情况的发生。通常情况下,这种错,发生在取数据的过程,比方从数据库查询数据,亦或者说是,发生在数据传输的过程中。譬如1packagetest;23importjava.util.List;......
  • CodeForces - 631A Interview (思想)水
    TimeLimit: 1000MS MemoryLimit: 262144KB 64bitIOFormat: %I64d&%I64uCodeForces-631AInterviewSubmit StatusDescriptionBlakeisaCEOofalargecompanycalled"BlakeTechnologies".Heloveshiscompanyverymuchandhethinksthathi......
  • 未提供与“Course.Course(string, int, int)”的所需参数“Name”对应的参数
    当传给类中的参数不确定有无时,则要给父类加个无参构造方法 ......
  • 【Introductory Biology】Lecture 7 - Replication 复制
    文章目录SlidesRefDNA复制是指DNA双链在细胞分裂间期阶段进行以一个亲代DNA分子为模板合成子代DNA链的过程。复制的结果是一条双链变成两条一样的双链(如果复制过程正常的话),每条双链都与原来的双链一样(排除突变等不定因素)。参与DNA复制叉工作的许多酶。SlidesRef【麻省理工公开课】......
  • Mysql Query error: BIGINT UNSIGNED value is out of range in..解决方法(转)
    原文:https://blog.51cto.com/bstdn/19510641、问题当字段类型为unsigned时,使用相关结果为负值时就会报错,报错如下:BIGINTUNSIGNEDvalueisoutofrangein..1.2、解决使用cast()修改字段类型为signedselectcast(quantityassigned)-cast(quantity2assign......
  • scandir,major和minor,state,无锁机制----比较交换CAS Compare And Swap,dirent,sprintf,fop
    文章目录1.Linuxc目录操作函数scandir2.Linux系统设备(device)的major和minornumber3.state4.无锁机制----比较交换CASCompareAndSwap5.dirent6.sprintf7.fopen8.atoi函数9.strtok10.strtol1.Linuxc目录操作函数scandir(1)头文件:#include<dirent.h>定义函数:intscandir(......
  • ERROR: pip's dependency resolver does not currently take into account all the pa
    报错原因:ERROR:pip'sdependencyresolverdoesnotcurrentlytakeintoaccountallthepackagesthatareinstalled.Thisbehaviouristhesourceofthefollowingdependencyconflicts.scipy1.7.3requiresnumpy<1.23.0,>=1.16.5,butyouhavenumpy......