Giter Site home page Giter Site logo

Comments (4)

Alex-JG3 avatar Alex-JG3 commented on July 28, 2024 1

was starting a new job so busy with admin, moving, etc.

Good luck with your new job!

Would you like to fix this, or should I?

Yes I am happy to fix this.

from skpro.

Alex-JG3 avatar Alex-JG3 commented on July 28, 2024

@fkiraly, tagging you incase you have not seen this.

It looks like the pandas' convert_dtypes function might be the problem.

https://github.com/sktime/skpro/blob/main/skpro/distributions/empirical.py#L129

Here is an example that is similar to the for loop here https://github.com/sktime/skpro/blob/main/skpro/distributions/empirical.py#L118.

>>> import pandas as pd
>>> df = pd.DataFrame(index=[1, 2, 3], columns=['a', 'b'])
>>> df.dtypes
a    object
b    object
dtype: object
>>> df.loc[1, 'a'] = 1.5
>>> df.loc[2, 'b'] = 1.6
>>> df
     a    b
1  1.5  NaN
2  NaN  1.6
3  NaN  NaN
>>> df.dtypes
a    object
b    object
dtype: object
>>> df_conv = df.convert_dtypes()
>>> df_conv.dtypes
a    Float64
b    Float64
dtype: object
>>> df_conv.values
array([[1.5, <NA>],
       [<NA>, 1.6],
       [<NA>, <NA>]], dtype=object)

So using convert_dtypes on a dataframe containing objects seems to give some unexpected datatypes. The resulting numpy array df_conv.values also has type object here which makes it difficult to work with.

Avoiding convert_dtypes might solve the issue.

from skpro.

fkiraly avatar fkiraly commented on July 28, 2024

Yes, I did not see this - was starting a new job so busy with admin, moving, etc. Also you opened this first in skbase, by accident (all fixed).

Would you like to fix this, or should I? If you are already working on tests, might be more synergistic if you do.

I'm busy with making the refactored version of the package "feature complete" for the presentation in mid-Sep and interoperable with sktime.

from skpro.

fkiraly avatar fkiraly commented on July 28, 2024

Yes I am happy to fix this.

thx!

from skpro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.