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 8321263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:57:23+00:00 2026-06-08T22:57:23+00:00

I would like to import data from a CSV file to use in scikit-learn.

  • 0

I would like to import data from a CSV file to use in scikit-learn. It has a mix of numerical data categorical data, e.g.

someValue,color,someOtherValue
1.2,red,55.6
1.9,blue,20.5
3.2,red,16.5

I need to convert this representation into a purely numerical one where categorical data points get converted into multiple binary columns, e.g.

someValue,colorIsRed,colorIsBlue,someOtherValue
1.2,1,0,55.6
1.9,0,1,20.5
3.2,1,0,16.5

Is there any utility that does this for me, or an easy way to iterate through the data and get this representation?

  • 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-08T22:57:28+00:00Added an answer on June 8, 2026 at 10:57 pm

    scikit-learn doesn’t offer data-loading functions as far as I know, but it does prefer Numpy arrays as input. Numpy’s loadtxt function together with its converters parameter can be used to load your csv and specify the types of each column. It does not binarize your second column though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to enable the user to import data from an xml file
How can I import a CSV file into a MySQL table? I would like
I have a data file in CSV format that has the some data like
i would like to create a interval which every hour import data from sql
I have the below script to import data from a csv file on my
I would like to use the COPY function in PostgreSQL to import a CSV
I am using PHP to import data from a CSV file using fgetcsv(), which
I have a csv file with dump data of table and I would like
Would like to parse IPv4 address from exit-addresses . Format of the file: ExitNode
i am using Docmd.TransferText to import data from a text file into my access

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.