mnordie opened a new issue, #40865:
URL: https://github.com/apache/arrow/issues/40865

   ### Describe the usage question you have. Please include as many useful 
details as  possible.
   
   
   When writing a table with only .0 floats using pa.csv.write_csv() the output 
truncates the .0 causing the read table to infer the column as int.
   Is it possible to override this behavior somehow?
   
   ```
   In [107]: floats_csv = io.BytesIO(b"""a,b,c
        ...: 1.0,1,one
        ...: 2.0,2,two
        ...: 3.0,3,three""")
   
   In [108]: t=pa.csv.read_csv(floats_csv)
   
   In [109]: t
   Out[109]: 
   pyarrow.Table
   a: double
   b: int64
   c: string
   ----
   a: [[1,2,3]]
   b: [[1,2,3]]
   c: [["one","two","three"]]
   
   In [110]: help(pa.csv.write_csv)
   
   
   In [111]: pa.csv.write_csv(t,'./float_test.csv')
   
   In [112]: !cat ./float_test.csv
   "a","b","c"
   1,1,"one"
   2,2,"two"
   3,3,"three"
   
   In [113]: pa.csv.read_csv('./float_test.csv')
   Out[113]: 
   pyarrow.Table
   a: int64
   b: int64
   c: string
   ----
   a: [[1,2,3]]
   b: [[1,2,3]]
   c: [["one","two","three"]]
   
   ```
   
   ### Component(s)
   
   Python


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to