Исходный файл для загрузки без заголовков
(.env) boris@boris-All-Series:~/VOTING/ADDHEADER$ cat dataFile.csv
7058,7069,7060,7061
sravan,bobby,ojaswi,deepu
21,23,22,21
linux,html/css,node-js,php-mysql
(.env) boris@boris-All-Series:~/VOTING/ADDHEADER$ cat dataFrame2.py
import pandas as pd
df = pd.read_csv ('./dataFile.csv',header = None)
print (df)
print("\n")
df.set_axis(["person1", "person2", "person3", "person4"],
axis=1,
inplace=True)
print(df)
(.env) boris@boris-All-Series:~/VOTING/ADDHEADER$ python3 dataFrame2.py
0 1 2 3
0 7058 7069 7060 7061
1 sravan bobby ojaswi deepu
2 21 23 22 21
3 linux html/css node-js php-mysql
person1 person2 person3 person4
0 7058 7069 7060 7061
1 sravan bobby ojaswi deepu
2 21 23 22 21
3 linux html/css node-js php-mysql
No comments:
Post a Comment