Reputation: 691
I have a url as string :-
url='https://www.business-standard.com/article/technology/xiaomi-mi-a2-india-launch-today-how-to-watch-livestream-know-specs-price-118080800144_1.html'
.
I want to add this url into pandas dataframe as text'. All I did as:-
data=pd.DataFrame(url,columns=['url'])
It gives error as:
ValueError:DataFrame constructor not properly called!
I don't get it where I did wrong?
Expected output :
url
https://www.business-standard.com/article/technology/xiaomi-mi-a2-india-launch-today-how-to-watch-livestream-know-specs-price-118080800144_1.html
........................
........................
.......................
Upvotes: 3
Views: 602
Reputation: 863256
Convert string to one element list by []
:
data=pd.DataFrame([url],columns=['url'])
print (data)
url
0 https://www.business-standard.com/article/tech...
Upvotes: 2