了解导入和打包的名称

时间:2019-01-02 21:34:06

标签: python package

from sklearn import linear_model

对于上面的代码,我了解“ sklearn”是一个软件包,那么“ liner_model”到底是什么?

1 个答案:

答案 0 :(得分:2)

它实际上可以是任何东西,模块级变量(即字符串,整数),类,函数或子模块。一些例子:

SEVERE: Unexpected exception in route
io.vertx.core.json.DecodeException: Failed to decode:Cannot construct instance of `java.util.LinkedHashMap` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('{'arr': [99, 2, 4, 1, 55, 0]')
 at [Source: (io.netty.buffer.ByteBufInputStream); line: 1, column: 1]
    at io.vertx.core.json.Json.decodeValue(Json.java:172)
    at io.vertx.core.json.JsonObject.fromBuffer(JsonObject.java:960)
    at io.vertx.core.json.JsonObject.<init>(JsonObject.java:73)
    at io.vertx.ext.web.impl.RoutingContextImpl.getBodyAsJson(RoutingContextImpl.java:263)
    at io.vertx.ext.web.impl.RoutingContextDecorator.getBodyAsJson(RoutingContextDecorator.java:123)
    at za.co.offerzen.SortVerticle.doBubbleSort(SortVerticle.java:80)
    at io.vertx.ext.web.impl.BlockingHandlerDecorator.lambda$handle$0(BlockingHandlerDecorator.java:48)
    at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:272)
    at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)

输出

from pandas import match
from pandas import json
from pandas import DataFrame
from pandas import __version__

print(match)
print(json)
print(DataFrame)

在这种情况下,<function match at 0x0000016BE3082950> # function <module 'pandas.json' from '\lib\site-packages\pandas\json.py'> # module <class 'pandas.core.frame.DataFrame'> # class 0.23.4 # string 根据其docs是一个模块:

  

sklearn.linear_model模块...