Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-4832

[Python] pandas Index metadata for RangeIndex is incorrect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • 0.14.0
    • Python
    • None

    Description

      I'm looking at ARROW-1639 to optimize storage and loading of RangeIndex, but in the meantime I wanted to report this oddness:

      In [9]: df = pd.DataFrame({'a': [1, 2, 3]})                                                    
      
      In [10]: json.loads(pa.Table.from_pandas(df).schema.metadata[b'pandas'])                       
      Out[10]: 
      {'index_columns': ['__index_level_0__'],
       'column_indexes': [{'name': None,
         'field_name': None,
         'pandas_type': 'unicode',
         'numpy_type': 'object',
         'metadata': {'encoding': 'UTF-8'}}],
       'columns': [{'name': 'a',
         'field_name': 'a',
         'pandas_type': 'int64',
         'numpy_type': 'int64',
         'metadata': None},
        {'name': None,
         'field_name': '__index_level_0__',
         'pandas_type': 'int64',
         'numpy_type': 'int64',
         'metadata': None}],
       'pandas_version': '0.23.4'}
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            wesm Wes McKinney
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: