Giter Club home page Giter Club logo

Comments (5)

shantanuo avatar shantanuo commented on May 20, 2024 1

I have never used this style, nor have I seen others chaining immediately after read_*
I am not an expert, I will like to know what does the community think about it.

from pyjanitor.

ericmjl avatar ericmjl commented on May 20, 2024

Currently not possible, it also is unclear to me why an inplace=True kwarg is needed for the pyjanitor family of functions. Every method chained function returns a dataframe, which means all we have to do is to assign the returned dataframe to a variable name.

from pyjanitor.

shantanuo avatar shantanuo commented on May 20, 2024

"inplace" parameter is not really needed. But I suggested it because a lot of pandas methods use it and clean_function will look like a native pandas method with this.
Which one of these 2 statements look more pythonic?
df=df.clean_names()
df.clean_names(inplace=True)
I guess the user should have both the options available.

from pyjanitor.

ericmjl avatar ericmjl commented on May 20, 2024

@shantanuo the expected use case of .clean_names() is usually after the data frame is constructed. Hence the examples:

df = (
    pd.read_csv(...)
    .clean_names()
    # chain more functions down here
)

These design of these functions is such that they should be chained, as opposed to being used on single lines.

from pyjanitor.

ericmjl avatar ericmjl commented on May 20, 2024

No worries, good to know. Btw, if you're interested in reading more of why I decided to put pyjanitor together, and develop it with the rest of the community, here's a document I'm working on: https://github.com/ericmjl/pyjanitor/blob/whitepaper/paper/manuscript.md

from pyjanitor.

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.