Skip to content
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.

Change the exporting if null. #130

Open
Patchus opened this issue Nov 14, 2014 · 0 comments
Open

Change the exporting if null. #130

Patchus opened this issue Nov 14, 2014 · 0 comments

Comments

@Patchus
Copy link

Patchus commented Nov 14, 2014

I do not want to export my records if they are null. This bit of code actually does that, but i image you would want something like use_nulls as an input variable. Basically if you dont want the nulls to be there, that should be an option :). This is part of the data.py file.

   elif isinstance(pd_obj, pd.DataFrame):
        # We have to explicitly convert the column names to strings
        # because the json serializer doesn't allow for integer keys.
        for i, row in pd_obj.iterrows():
            for num, (k, v) in enumerate(row.iteritems()):
                value = {}
                if pd.notnull(v) == True and use_nulls = False:
                    value['idx'] = cls.serialize(i)
                    value['col'] = cls.serialize(k)
                    value['val'] = cls.serialize(v)
                    if grouped:
                            value['group'] = num
                    vega_data.values.append(value)
              elif use_null = True:
                    vega_data.values.append(value)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant