你好,
既然 JMP 18 支援 Python,如何將 JMP 表直接轉換為 Apache Parquet 檔案格式,而無需先將其轉換為 CSV 檔案?
JMP18
我不熟悉 parquet 格式,但這個網站展示瞭如何從 python 編寫 parquet 檔案。
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
weather_schema = pa.schema([
('city', pa.string()),
('measurement_time', pa.timestamp('ms')),
('temperature', pa.float32()),
('atmospheric_pressure', pa.float32())
])
# Create a Pandas data frame with some sample weather data
df = pd.DataFrame({
'city': ['New York', 'London', 'Tokyo'],
'measurement_time': ['2022-05-01 12:00:00', '2022-05-01 12:00:00', '2022-05-01 12:00:00'],
'temperature': [20.5, 15.2, 23.1],
'atmospheric_pressure': [101.5, 99.2, 100.1]
})
# Convert the Pandas DataFrame to a PyArrow table
table = pa.Table.from_pandas(df, schema=weather_schema)
# Write the PyArrow table to a Parquet file
pq.write_table(table, 'test/weather_data.parquet')
https://saturncloud.io/blog/how-to-write-data-to-parquet-with-python/
上週的 JMP18 培訓期間提到了 JMP 中的 Parquet 檔案支援。
是的,特別是透過 python。我提到了 parquet 檔案的資料導入,作為 JMP 18 中 python 整合的價值的範例。
好的,但我問的是如何直接從 JMP 18 將 JMP 檔案匯出為 Parquet 檔案格式。
要將 JMP 資料表匯出到 Parquet,您需要使用類似於我上面顯示的範例的 Python。 JMP 本身不支援 Parquet。