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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:06:15+00:00 2026-05-22T12:06:15+00:00

My input: test_set , like: [[‘4.5’, ‘6’, ‘U1’], [‘5’, ‘5’, ‘U1’], [‘5’, ‘7’, ‘U1’],

  • 0

My input:

test_set, like:

[['4.5', '6', 'U1'], ['5', '5', 'U1'], ['5', '7', 'U1'], ['7', '6.5', 'U1'], ['5.5', '5.5', 'U2'], ['5.5', '7.5', 'U2']]

After this I made a lot of calculation with this data, and my “final” result is array of test_set_final

test_set_final=array([[ 1.6488378 ],
       [ 2.61782463],
       [ 0.62126043],
       [ 1.00322042],
       [ 2.08938831],
       [ 0.09282412]])

Now what I want to do is for test_set_final, add class name which is “stored” in last place of test_set, so that result will look, for example for test_set_final:

test_set_final=[['1.6488378' , 'U1'],['2.61782463' , 'U1'],['0.62126043' , 'U1'],['1.00322042' , 'U1'],['2.08938831' , 'U2'],,['0.09282412' , 'U2']]

This “test_set” data is random data and have random name of “classes”, but always on last place after comma….

  • 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-22T12:06:16+00:00Added an answer on May 22, 2026 at 12:06 pm

    This should do it (had it prepared from the last version of your question):

    test_set_final = [[r, c[-1]] for [r], c in zip (test_set_final, test_set)]
    

    Edit: Added unpacking for r – the example looked different before.

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

Sidebar

Related Questions

Exception in thread Thread-2 java.lang.NumberFormatException: For input string: 3 int test = Integer.parseInt(result[0]); This
I have something like this: class Vehicle def self.set_color(input) if %w{blue red green}.include?(input) input
I'm trying for hours to implement a scenario like this, but with input parameters
Imagine a form like this: <form action=test.php method=post> <input type=text name=firstname value=<?=set_value('firstname')?> /> <input
I have some data like this: 1 2 3 4 5 9 2 6
How to write tests where conditions like the following arise: Test user Input. Test
i want the following functionality. input : this is test <b> bold text </b>
So given this input string: =?ISO-8859-1?Q?TEST=2C_This_Is_A_Test_of_Some_Encoding=AE?= And this function: private string DecodeSubject(string input) {
I have a form that I pre-populate with test data though jQuery. $('INPUT[name=subscription.FirstName]').val('Jef'); but
I have this (simplification): $(li).click(function{alert(test);}); <li> <input> </li> What's the best way to bind

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.