Importing dataset in Python

dataset = [library alias name].read_csv(‘file.csv’)

x = dataset.iloc[:,:-1].values

y = dataset.iloc[:, -1].values

In the above lines, read_csv and iloc are functions.

[:,:-1] is slicing range of the values.

Facebook Comments

Leave a Reply

Your email address will not be published. Required fields are marked *