Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • $\begingroup$ Works nicely when the {row, column} element of the dataset is a digit, but converts to Null when the element contains no digits and returns a 0. when the element is a string partially containing a number within it (eg name of turbine type is " V90-3.0) . Not sure how to structure conditionals. $\endgroup$ Commented Aug 7, 2021 at 16:58
  • $\begingroup$ Perhaps I didn't make my question clear. I am dealing with columns of a dataset, so the function(s) need to operate over a list. I assume I can Flatten and then put all entries in a single list, apply the function and then ArrayReshape to reconstruct the new dataset. The function f[x_] := StringJoin[Select[Characters[x], Or[DigitQ[#], # == "."] &]] when operating on the 4 types of data here ToExpression[f /@ {"Other", "1,574", "732", "V80-1.8/2.0 MW®"}] returns {Null, 1574, 732, 0.} What I am looking for is a function that will return {"Other",1574,732,"V80-1.8/2.0 MW®"} $\endgroup$ Commented Aug 8, 2021 at 1:17