zak100 Posted August 27, 2020 Share Posted August 27, 2020 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 More sharing options...
Prometheus Posted August 27, 2020 Share Posted August 27, 2020 You're just missing a pair of square brackets. 1 Link to comment Share on other sites More sharing options...
zak100 Posted August 28, 2020 Author Share Posted August 28, 2020 Hi, Thanks, it worked. God bless you. Zulfi. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now