Jump to content

Python: Array Problem


zak100

Recommended Posts

Hi,

I am trying to compile the following program:

import numpy as np
import sklearn.preprocessing
from sklearn import preprocessing

Input_data = np.array([2.1, -1.9, 5.5],
                       [-1.5, 2.4, 3.5],
                       [0.5, -7.9, 5.6],
                       [5.9, 2.3, -5.8])
data_binarized = preprocessing.Binarizer(threshold = 0.5). transform(Input_data)
print("\nBinarized data:\n", data_binarized)

 

I am getting the following error:

Traceback (most recent call last):
  File "/home/zulfi/PycharmProjects/AI/AI1.py", line 8, in <module>
    [5.9, 2.3, -5.8])
TypeError: array() takes from 1 to 2 positional arguments but 4 were given

Process finished with exit code 1


Some body please  guide me.

 

Zulfi.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.