Open bml1g12 opened 7 months ago
Maybe the issue is related to a difference between
import { DataFrame } from "danfojs-node/dist/danfojs-base"
import { DataFrame } from "danfojs-node"
which means that the latter is not equal to the former, and the former is returned in some cases, whereas the latter is imported by default
Is your feature request related to a problem? Please describe.
I am unclear on the recommended way of type narrowing a
dfd.Series ❘ dfd.DataFrame
object to adfd.DataFrame
Describe the solution you'd like
e.g. this should work, or some other approach that achieves the type narrowing
The above code snippet does not work as it can log " "Expected a DataFrame here but got DataFrame"" i.e. false positive, and I would like a solution like this to type narrow
Describe alternatives you've considered
The above code snippet returns False
If there was a method to convert Series to DataFrame (https://github.com/javascriptdata/danfojs/issues/619) that would be a suitable workaround
Additional context
For working with Danfo, I think such type narrowing is essential
Returns
So not sure what the problem is here.
This is my current workaround: