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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:17:43+00:00 2026-05-29T06:17:43+00:00

I have an excel spreadsheet that has dates in the first column, the rest

  • 0

I have an excel spreadsheet that has dates in the first column, the rest is the numeric values observed for each attribute. I imported the whole data set using read/readlines function.

How do I separate the imported data into datearray (first column in the imported dataset) and a separate matrix of numeric values ( data that I want to work on)?

For example:

I am importing the following data:

ObservationDate Attribute1 Attribute2 Attribute3

01/01/2012 105 101 100

02/01/2012 101 101 95

03/01/2012 98 95 97

I would like to create the following from this data:

DateArrayList = [01/01/2012, 02/01/2012, 03/01/2012]

             105        101         100   

ValuesMatrix =
101 101 95

             98         95          97
  • 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-05-29T06:17:43+00:00Added an answer on May 29, 2026 at 6:17 am

    These list comprehensions should do what you’re looking for (assume that the data is in testdata.xls, and that it is tab-delimited):

    with open("testdata.xls") as inf:
        next(inf)
        lines = [l[:-1].split("\t") for l in inf]
    
    date_array_list = [l[0] for l in lines]
    values_matrix = [map(int, l[1:]) for l in lines]
    
    print date_array_list
    print values_matrix
    

    This prints

    ['01/01/2012', '02/01/2012', '03/01/2012']
    [[105, 101, 100], [101, 101, 95], [98, 95, 97]]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large Excel spreadsheet with a column that has an identifying number.
I have a sharepoint site that has an excel spreadsheet that I need to
I have an excel spreadsheet that has 2 columns. Something like this |ColA |
I have data in an Excel spreadsheet that has 10,000 rows with the following
I have a Excel spreadsheet that has two tabs, I have data on the
I have an excel spreadsheet that has about 18k rows and three columns. I
I have one Excel spreadsheet which has the following columns: Surname / First Name
I have a spreadsheet that has several worksheets, each containing a hundred or so
I have an Excel spreadsheet that uses a TFS query to pull information on
I have an Excel spreadsheet that looks like: spreadsheet http://img186.imageshack.us/img186/6495/exelf.jpg I'd like to convert

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.