Skip to content

Fixed #233 - Using parquet and pyArrow, when R/W files #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 183 additions & 0 deletions visualpython/data/m_library/pandasLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -6825,6 +6825,189 @@ define([
},
]
},
// ***
"pd_toParquet": {
"name": "To Parquet",
"library": "pandas",
"description": "DataFrame/Series to Parquet file",
"code": "${i0}.to_parquet(${path}${etc})",
"options": [
{
"name": "i0",
"label": "DataFrame",
"required": true,
"component": [
"data_select"
],
"var_type": [
"DataFrame",
"Series"
]
},
{
"name": "path",
"label": "File path/variable",
"required": true,
"type": "text"
}
]
},
"pd_readParquet": {
"name": "Read Parquet",
"library": "pandas",
"description": "Parquet to pandas object",
"code": "${o0} = pd.read_parquet(${i0}${etc})",
"options": [
{
"name": "i0",
"label": "File path/object",
"required": true,
"type": "text",
"component": [
"file"
]
},
{
"name": "o0",
"label": "Allocate to",
"output": true,
"component": [
"input"
],
"value": "vp_df"
},
]
},
"pa_readCsv": {
"name": "Read Csv as pyarrow",
"library": "pyarrow",
"description": "Csv to pandas object",
"code": "${o0} = pa.csv.read_csv(${i0}${etc}).to_pandas()",
"options": [
{
"name": "i0",
"label": "File path/object",
"required": true,
"type": "text",
"component": [
"file"
]
},
{
"name": "o0",
"label": "Allocate to",
"output": true,
"component": [
"input"
],
"value": "vp_df"
}
]
},
"pa_toCsv": {
"name": "To Csv as pyarrow",
"library": "pyarrow",
"description": "DataFrame/Series to csv file",
"code": "pa.csv.write_csv(${i0}, ${path})",
"options": [
{
"name": "i0",
"label": "DataFrame",
"required": true,
"component": [
"data_select"
],
"var_type": [
"DataFrame",
"Series"
]
},
{
"name": "path",
"label": "File path/variable",
"required": true,
"type": "text"
}
]
},
"pa_readJson": {
"name": "Read Json as pyarrow",
"library": "pyarrow",
"description": "Json to pyarrow object",
"code": "${o0} = pa.json.read_json(${i0}${etc}).to_pandas()",
"options": [
{
"name": "i0",
"label": "File path/object",
"required": true,
"type": "text",
"component": [
"file"
]
},
{
"name": "o0",
"label": "Allocate to",
"output": true,
"component": [
"input"
],
"value": "vp_df"
}
]
},
"pa_readParquet": {
"name": "Read Parquet as pyarrow",
"library": "pyarrow",
"description": "Parquet to pandas object",
"code": "${o0} = pa.parquet.read_table(${i0}${etc}).to_pandas()",
"options": [
{
"name": "i0",
"label": "File path/object",
"required": true,
"type": "text",
"component": [
"file"
]
},
{
"name": "o0",
"label": "Allocate to",
"output": true,
"component": [
"input"
],
"value": "vp_df"
}
]
},
"pa_toParquet": {
"name": "To Parquet as pyarrow",
"library": "pyarrow",
"description": "DataFrame/Series to Parquet file",
"code": "pa.parquet.write_table(${i0}, ${path})",
"options": [
{
"name": "i0",
"label": "DataFrame",
"required": true,
"component": [
"data_select"
],
"var_type": [
"DataFrame",
"Series"
]
},
{
"name": "path",
"label": "File path/variable",
"required": true,
"type": "text"
}
]
},
}

return {
Expand Down
10 changes: 8 additions & 2 deletions visualpython/js/com/com_Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ define([
'import matplotlib.pyplot as plt',
'%matplotlib inline',
'import seaborn as sns',
'import plotly.express as px'
'import plotly.express as px',
'import pyarrow as pa'
],
'matplotlib customizing': [
'import matplotlib.pyplot as plt',
Expand Down Expand Up @@ -132,7 +133,8 @@ define([
'from plotly.offline import init_notebook_mode',
'init_notebook_mode(connected=True)'
]
}
},
{ library: 'pyarrow', alias:'pa' },
]
}

Expand Down Expand Up @@ -208,6 +210,10 @@ define([
'statsmodels.api': {
code: 'import statsmodels.api as sm',
type: 'package'
},
'pyarrow': {
code: 'import pyarrow as pa',
type: 'package'
}
}

Expand Down
Loading