"To do"
import csv
data = [ [1,2,3,4],[5,6,7,8]]
csvfile = open("C:/Users/user/Desktop/Web_Study/Dance_Match/DanceMatch.csv", "w", newline="")
print("성공")
csvwriter = csv.writer(csvfile)
for row in data:
csvwriter.writerow(row)
csvfile.close()를 입력하세요
Def_GangNam_MWF_A.to_csv("C:/Users/user/Desktop/Web_Study/Dance_Match/Dance.csv", encoding="utf-8-sig")
maybe check the specific folder or file . and permit the access....!!!
or
you should close csv file while saving df into csv. close the csv file and run the python again
Def_GangNam_Total_DF = pd.concat( [ Def_GangNam_MWF_A_DF, Def_GangNam_TUETHR_A_DF, Def_GangNam_SS_A_DF, Def_GangNam_MWF_B_DF, Def_GangNam_TUETHR_B_DF, Def_GangNam_SS_B_DF ], axis = 0)
print(Def_GangNam_Total_DF)
Main point here is, you need [ ] , inside ( )
axix = 0 . is default, merging by rows( top, + bottom )
BUT, I also want to increase index of rows
just above code does not automatically increase index
Def_GangNam_Total_DF = Def_GangNam_Total_DF.reset_index(drop = True)
print(Def_GangNam_Total_DF)
you have to go for two processes
1) delete exiting indexes
2) reset index
adding "drop = True" options is needed to delete existing index