Coder Social home page Coder Social logo

facultyai / marshmallow-dataframe Goto Github PK

View Code? Open in Web Editor NEW
24.0 2.0 3.0 78 KB

Marshmallow Schema generator for Pandas DataFrames

Home Page: https://pypi.org/project/marshmallow-dataframe/

License: Apache License 2.0

Python 100.00%
pandas dataframe schema validation marshmallow python

marshmallow-dataframe's People

Contributors

srstevenson avatar zblz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

marshmallow-dataframe's Issues

How to use a separate module?

Hello, thank you very much for your project, I've been looking for a more practical way to do a schema treatment with pandas.

I would like some help, in my project, separated schema into a module and instantiate, for example, the class DataSchema (SplitDataFrameSchema). But she dont recognize Meta parameter, dtype, how can I dynamically assign it (based on the input data)?

My structure in Tree:

├── app
│   ├── api.py
│   ├── __init__.py
│   ├── db
│   │   ├── core.py
│   │   ├── __init__.py
│   ├── resources
│   │   ├── analysis_data.py
│   │   ├── __init__.py
│   ├── schemas.py
│   └── utils.py
├── config.py
├── connections.log
└── main.py

My Schema code:

from marshmallow_dataframe import SplitDataFrameSchema

class DataSchema(SplitDataFrameSchema):
    """Automatically generated schema for dataframe"""

    class Meta:
        dtypes = self.dtypes

Should index be mandatory on split format?

Hi, and thanks for the work on this package !
I am also trying to get that working nicely together...

I recently encountered :

{'index': ['Missing data for required field.']}

But I expected index to be optional (when not present assume range(n), same as pandas.DataFrame()

What do you think ?

Support categorical columns

Right now categorical columns are always recognised as a string dtype, which could be wrong. In addition, we are not validating that the deserialised values are one of the category options.

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.