python question – www.savvyessaywriters.net

python question – www.savvyessaywriters.net

 

I have the folowing piece of python code (in Jupyter notebook):

import numpy as np

import pandas as pd

my_list = [“A”, “B”, “C”,”D” ,”E”]

for i in my_list:

d = {‘value’: [1,2,3,4,5],’country’: [‘ES’,’IT’,’US’,’FR’,’NL’]}

df = pd.DataFrame(data=d)

print(df)


The output is:

  country  value_x000D_
0      ES      1_x000D_
1      IT      2_x000D_
2      US      3_x000D_
3      FR      4_x000D_
4      NL      5_x000D_
  country  value_x000D_
0      ES      1_x000D_
1      IT      2_x000D_
2      US      3_x000D_
3      FR      4_x000D_
4      NL      5_x000D_
  country  value_x000D_
0      ES      1_x000D_
1      IT      2_x000D_
2      US      3_x000D_
3      FR      4_x000D_
4      NL      5_x000D_
  country  value_x000D_
0      ES      1_x000D_
1      IT      2_x000D_
2      US      3_x000D_
3      FR      4_x000D_
4      NL      5_x000D_
  country  value_x000D_
0      ES      1_x000D_
1      IT      2_x000D_
2      US      3_x000D_
3      FR      4_x000D_
4      NL      5_x000D_
_x000D_

I want to write this output in excel csv file using the command : df.to_csv(“filename.csv” , index = False).

Where should I put this command in order to get an excel document as the output of my code?

In particular, I would prefer to get the column names “country” and “value” only once on the top of my excel document. Therefore the csv file should be like this:

   country  value_x000D_
0      ES      1_x000D_
1      IT      2_x000D_
2      US      3_x000D_
3      FR      4_x000D_
4      NL      5_x000D_
 _x000D_
0      ES      1_x000D_
1      IT      2_x000D_
2      US      3_x000D_
3      FR      4_x000D_
4      NL      5_x000D_
  _x000D_
0      ES      1_x000D_
1      IT      2_x000D_
2      US      3_x000D_
3      FR      4_x000D_
4      NL      5_x000D_
  _x000D_
0      ES      1_x000D_
1      IT      2_x000D_
2      US      3_x000D_
3      FR      4_x000D_
4      NL      5_x000D_
  _x000D_
0      ES      1_x000D_
1      IT      2_x000D_
2      US      3_x000D_
3      FR      4_x000D_
4      NL      5

Savvy Essay Writers

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational