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

[Python] pa.array does not use "from_pandas" semantics for pd.Index

    XMLWordPrintableJSON

Details

    Description

      In [15]: idx = pd.Index([1, 2, np.nan], dtype=object)                                                                                                                                                              
      
      In [16]: pa.array(idx)                                                                                                                                                                                             
      Out[16]: 
      <pyarrow.lib.DoubleArray object at 0x7f2e24300780>
      [
        1,
        2,
        nan
      ]
      
      In [17]: pa.array(idx, from_pandas=True)                                                                                                                                                                           
      Out[17]: 
      <pyarrow.lib.Int64Array object at 0x7f2e242d3678>
      [
        1,
        2,
        null
      ]
      
      In [18]: pa.array(pd.Series(idx))                                                                                                                                                                                  
      Out[18]: 
      <pyarrow.lib.Int64Array object at 0x7f2e242d3780>
      [
        1,
        2,
        null
      ]
      

      We should probably handle Series and Index the same in this regard.

      Attachments

        Issue Links

          Activity

            People

              jorisvandenbossche Joris Van den Bossche
              jorisvandenbossche Joris Van den Bossche
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: