I was web scrapping and trying to remove , from date for csv file but it is not happening I am unable to understand what is wrong with my code
code:
i=0
with open(filename,“w”,encoding=“utf-8”) as f:
header_string=’,’.join(column_titles)
header_string+=’\n’
f.write(header_string)
for row in table_rows:
i=i+1
row_string=""
#date is in 2nd column
if(i==2):
for w in row[2]:
w=w.replace(',',' ')
row_string+=w
row_string+=','.join(row)
row_string+='\n'
f.write(row_string)
i++
import pandas as pd
df=pd.read_csv(‘android_version_history.csv’)
df.head()
Name Version number(s) Initial stablerelease date Supported (security fixes) API level References
Cupcake 1.5 April 27 2009 No 3 [14][16]
September 15 2009Donut 1.6 September 15 2009 No 4 [14][17]
Eclair 2.0 – 2.1 October 26 2009 No 5 – 7 [14][18]
Froyo 2.2 – 2.2.3 May 20 2010 No 8 [14][19]
Gingerbread 2.3 – 2.3.7 December 6 2010 No 9 – 10 [14][20]