Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9170595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:02:44+00:00 2026-06-17T16:02:44+00:00

If I use from sklearn import * or from skleanr import datasets , then

  • 0

If I use from sklearn import * or from skleanr import datasets, then I can use datasets in the following way: iris = datasets.load_iris().

However, import sklearn and import sklearn as sk do not work as I expect. For example I cannot use sklearn.datasets.import_iris() or sk.datasets.import_iris(). Do I misinterpret the import syntax? And it it is the case, what is the correct way to use import.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:02:44+00:00Added an answer on June 17, 2026 at 4:02 pm

    No, you are not misinterpreting it. It’s the package structure of this particular project.

    When you import sklearn, you import a special python file __init__.py in a directory sklearn, that has inside of it another package called datasets. But if sklearn itself doesn’t import the nested package into it’s __init__.py file, you cannot use attribute traversal to get to that nested package.

    The solution is to import the nested package explicitly, yourself:

    import sklearn.datasets
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I use from time import time , the Python 2.7.3 does not recognize
in python, I would like to use: from pylab import * Then use plot
I have a COM object that I'm trying to use from C++ (not .NET),
Is there a built parser that I can use from C# that can parse
I have an extension method which I can use from the .cs codebehind of
How can I use git from within Xcode? I've found SVN easy to use
I want to write a PHP script that I can use from the command
Is there a utility function like HtmlDecode that I can use from PHP?
I have a asp.net web-service which I use from my ASP.NET website. I can
i'm trying to generate classes that i can use from the validator xsd files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.