give columns while reading csv 1

give columns while reading csv

colnames=['TIME', 'X', 'Y', 'Z'] 
user1 = pd.read_csv('dataset/1.csv', names=colnames, header=None)

Here is what the above code is Doing:
1. We are reading the csv file using the pandas read_csv function.
2. We are passing the column names as a list to the names parameter.
3. We are passing None to the header parameter because our csv file doesn’t have any header.
4. We are storing the dataframe in a variable called user1.

Similar Posts