I've created the following code in R.
data=c("Sepal.Length","Sepal.Width","Petal.Length","Petal.Width")
terms<- paste(data, collapse='+')
and this gives;
"Sepal.Length+Sepal.Width+Petal.Length+Petal.Width"
Is there a way of doing something similar in Python / Pandas?
use join:
d = ["Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width"]
x = '+'.join(d)
print(x)
output:
Sepal.Length+Sepal.Width+Petal.Length+Petal.Width
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With