Code Monkey home page Code Monkey logo

Comments (3)

westernguy2 avatar westernguy2 commented on May 19, 2024

This is another bug where Lux isn't supporting CategoricalDtype. Specifically, both cut and qcut output a column of CategoricalDtype.

import pandas as pd
import numpy as np
import lux

url = 'https://github.com/lux-org/lux-datasets/blob/master/data/cars.csv?raw=true'
df = pd.read_csv(url)
df['Year'] = pd.to_datetime(df['Year'], format='%Y')

df["Weight"] = pd.qcut(df["Weight"], q = 3)
import pandas as pd
import numpy as np
import lux

url = 'https://github.com/lux-org/lux-datasets/blob/master/data/cars.csv?raw=true'
df = pd.read_csv(url)
df['Year'] = pd.to_datetime(df['Year'], format='%Y')

df["Weight"] = pd.cut(df["Weight"], bins = [0, 2500, 7500, 10000], labels = ["small", "medium", "large"])

Both code blocks have the same error:
Screen Shot 2020-09-13 at 12 42 22 AM

from lux.

westernguy2 avatar westernguy2 commented on May 19, 2024

Another bug for Category dtype is for this example:

import pandas as pd
import numpy as np
import lux

url = 'https://github.com/lux-org/lux-datasets/blob/master/data/cars.csv?raw=true'
df = pd.read_csv(url)
df['Year'] = pd.to_datetime(df['Year'], format='%Y')

new_df = df.drop([0, 1, 2], axis = "rows")
pd.merge(df, new_df, how = "left", indicator = True)

The indicator argument creates a column of dtype category called _merge, resulting in this bug:
Screen Shot 2020-09-21 at 12 22 56 AM

This happens because Lux can't handle category dtype, so it doesn't assign it a data type.

from lux.

dorisjlee avatar dorisjlee commented on May 19, 2024

This is resolved with @westernguy2's new PRs!

from lux.

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.