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

  • Home
  • SEARCH
  • 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 8652585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:20:29+00:00 2026-06-12T14:20:29+00:00

Okay if you would like to know how this numpy array is created look

  • 0

Okay if you would like to know how this numpy array is created look at these questions

  • How can I add items to collection.Counter? and then sort them into ASC?
  • Porter Stemmer Algorithm Not returning the expected output? when modified into def

Lets presume I have a numpy array that looks like (created from this after preprocessing, the array below has also been shuffled by numpy so the result is random)

[[ 3  2  2 ...,  0  0  0]
 [14  1  0 ...,  0  0  0]
 [ 3  2  1 ...,  0  0  0]
 ..., 
 [ 1  1  1 ...,  0  0  0]
 [ 2  2  2 ...,  0  0  0]
 [ 1  1  0 ...,  0  0  0]]

I understand the data is large, it consists of 600 emails (each email consisting of about 2000 words) with statistics on 196 common spam words from around the internet on each email.

I would like to use it within Stephen Marsland K-Means Neurel Network that states in the comments "won't work if (0,0,...0) is in data" but I’m unsure on what this comment is referring to? (I thought that ... symbol was the same as it is in Math e.g. 1...n, there is stuff between 1 and n). If it means something else how should I tackle the problem with the invalid divide? thanks!

I’m not sure but something in my data set is causing this error

RuntimeWarning: invalid value encountered in divide data = transpose(transpose(data)/normalisers)
  • 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-12T14:20:30+00:00Added an answer on June 12, 2026 at 2:20 pm

    The ..., just indicates that there’s too much data to print to the console at once. I think the comment in the code you link to means that the preprocessing won’t work if there are any all-zero vectors in your data.

    The following will return True if you have any all-zero feature vectors…

    np.any(data.sum(1) == 0)
    

    …assuming that your rows are data examples and your columns are features.

    Here’s what’s happening:

    >>> from numpy import *
    >>> data = array([[0,0,0],[1,2,3],[1,0,1]])
    >>> normalisers = sqrt(sum(data**2,axis=1))*ones((1,shape(data)[0]))
    >>> normalisers
    array([[ 0.        ,  3.74165739,  1.41421356]])
    

    And then you’re dividing by zero.

    >>> data = transpose(transpose(data)/normalisers)
    

    One option might be to simply add one to every feature prior to the preprocessing step:

    data += 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay guys, I would like to know the following comments I made in this
Okay at first I thought this would be pretty straightforward. But I can't think
I just would like to know how can I dynamically change a label's values
Okay, so if you would like a back story, look at my previous question
Okay, I know this is going to sound like homework; but here goes any
Okay, here is what i would like to do. Class Container<T> { T contained;
In my HTML: <table> <tr><td>product 1</td><td>image 1</td></tr> <tr><td>product 2</td><td>image 2</td></tr> </table> would look like
Okay i know this has been asked a lot but it seems that none
Regarding my question about Gaussian noise reduction , I would like to know of
Okay i know this has been a question asked b4, but since it should

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.