-1
안녕과 파일을 CSV에 새 행을 추가하는 방법은 그래서 표시, 그래서 나는 CSV 파일로 네 개의 변수 (점수, 성별, 클래스와 이니셜)를 추가하려고 :팬더
with open ('untitled.csv','w') as file_out:
file_out.write(score)
file_out.write(real_player_class)
file_out.write(current_player_gender)
file_out.write(current_player_initials)
df_test = pd.read_csv('untitled.csv')
df_test
나는 Dataframe에서 다음과 같이하는 결과를 싶습니다이처럼 아래 통계와
score gender class initials
을 :
를score gender class initials
1 M senior YTU
현재, 내 코드에서, 이것은 dataframe의 (a dataframe에) 모습입니다 : 0seniorMYTU
을이 문제를 해결하는 방법이 있나요? 스코어, 젠더, 클래스 및 머리 글자 변수를 각 열에 어떻게 추가합니까?
감사합니다.
예제를 연습하면서 [튜토리얼] (https://docs.python.org/3/tutorial/index.html)을 통해 시간을 투자해야합니다. 파이썬에서 제공하는 도구에 대해 소개하고 문제 해결을위한 아이디어를 얻을 수도 있습니다. – wwii
https://docs.python.org/3/library/csv.html – wwii