Transfer and write Parquet with python and pandas got timestamp error

Neil Su

I tried to concat() two parquet file with pandas in python .
It can work , but when I try to write and save the Data frame to a parquet file ,it display the error :

 ArrowInvalid: Casting from timestamp[ns] to timestamp[ms] would lose data:

I checked the doc. of pandas, it default the timestamp syntax in ms when write the parquet file.
How can I white the parquet file with used schema after concat?
Here is my code:

import pandas as pd

table1 = pd.read_parquet(path= ('path.parquet'),engine='pyarrow')
table2 = pd.read_parquet(path= ('path.parquet'),engine='pyarrow')

table = pd.concat([table1, table2], ignore_index=True) 
table.to_parquet('./file.gzip', compression='gzip')
Axel

Pandas already forwards unknown kwargs to the underlying parquet-engine since at least v0.22. As such, using table.to_parquet(allow_truncated_timestamps=True) should work - I verified it for pandas v0.25.0 and pyarrow 0.13.0. For more keywords see the pyarrow docs.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Transfer and write Parquet with python and pandas got timestamp error

From Java

How to write parquet file from pandas dataframe in S3 in python

From Dev

converting parquet file to pandas and then querying gives error

From Dev

Python Pandas ix timestamp

From Dev

How to write TIMESTAMP logical type (INT96) to parquet, using ParquetWriter?

From Dev

python pandas Transfer the format of the dataframe

From Dev

Write a json to a parquet object to put into S3 with Lambda Python

From Dev

Python: Adding hours to pandas timestamp

From Dev

Datetime and Timestamp equality in Python and Pandas

From Dev

Timestamp conversion to datetime Python, Pandas

From Dev

Datetime and Timestamp equality in Python and Pandas

From Dev

Python, Pandas, convert Timestamp to Period

From Dev

Is pandas.timestamp python datetime?

From Dev

got error TypeError: urlretrieve() got an unexpected keyword argument 'CablingFilename' python

From Dev

C write uint16 to file got Error

From Dev

Python Pandas 0.14.0. Error with timestamp format when using dataframe.to_sql

From Dev

Python threading error, anyone got a solution?

From Dev

python urllib got [Errno socket error]

From Dev

Python threading error, anyone got a solution?

From Dev

Pandas Timestamp - Cannot convert arg to a time error

From Dev

Pandas Timestamp - Cannot convert arg to a time error

From Dev

Read group of rows from Parquet file in Python Pandas / Dask?

From Dev

CSV write error in Python

From Dev

PhoneGap File Transfer Error 1, where to write FileTransfers?

From Dev

Python Pandas: detecting existence of timestamp in Series

From Dev

Python: reduce precision pandas timestamp dataframe

From Dev

.json extension file + timestamp + Pandas + Python

From Dev

Python pandas: extract date and time from timestamp

From Dev

Python Pandas: Split DateTimeIndex in two at missing timestamp

Related Related

  1. 1

    Transfer and write Parquet with python and pandas got timestamp error

  2. 2

    How to write parquet file from pandas dataframe in S3 in python

  3. 3

    converting parquet file to pandas and then querying gives error

  4. 4

    Python Pandas ix timestamp

  5. 5

    How to write TIMESTAMP logical type (INT96) to parquet, using ParquetWriter?

  6. 6

    python pandas Transfer the format of the dataframe

  7. 7

    Write a json to a parquet object to put into S3 with Lambda Python

  8. 8

    Python: Adding hours to pandas timestamp

  9. 9

    Datetime and Timestamp equality in Python and Pandas

  10. 10

    Timestamp conversion to datetime Python, Pandas

  11. 11

    Datetime and Timestamp equality in Python and Pandas

  12. 12

    Python, Pandas, convert Timestamp to Period

  13. 13

    Is pandas.timestamp python datetime?

  14. 14

    got error TypeError: urlretrieve() got an unexpected keyword argument 'CablingFilename' python

  15. 15

    C write uint16 to file got Error

  16. 16

    Python Pandas 0.14.0. Error with timestamp format when using dataframe.to_sql

  17. 17

    Python threading error, anyone got a solution?

  18. 18

    python urllib got [Errno socket error]

  19. 19

    Python threading error, anyone got a solution?

  20. 20

    Pandas Timestamp - Cannot convert arg to a time error

  21. 21

    Pandas Timestamp - Cannot convert arg to a time error

  22. 22

    Read group of rows from Parquet file in Python Pandas / Dask?

  23. 23

    CSV write error in Python

  24. 24

    PhoneGap File Transfer Error 1, where to write FileTransfers?

  25. 25

    Python Pandas: detecting existence of timestamp in Series

  26. 26

    Python: reduce precision pandas timestamp dataframe

  27. 27

    .json extension file + timestamp + Pandas + Python

  28. 28

    Python pandas: extract date and time from timestamp

  29. 29

    Python Pandas: Split DateTimeIndex in two at missing timestamp

HotTag

Archive