Skip to content

Commit ae0441f

Browse files
author
minjk-bl
committed
Add read_sas read_spss
1 parent c30c54c commit ae0441f

File tree

4 files changed

+114
-26
lines changed

4 files changed

+114
-26
lines changed

visualpython/data/m_library/pandasLibrary.js

Lines changed: 93 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ define([
158158
}
159159
]
160160
},
161-
"pd004": {
161+
"pd_readCsv": {
162162
"name": "Read CSV",
163163
"library": "pandas",
164164
"description": "",
@@ -245,7 +245,7 @@ define([
245245
}
246246
]
247247
},
248-
"pd005": {
248+
"pd_toCsv": {
249249
"name": "To CSV",
250250
"library": "pandas",
251251
"description": "dataframe to csv",
@@ -3505,7 +3505,7 @@ define([
35053505
}
35063506
]
35073507
},
3508-
"pd076": {
3508+
"pd_readJson": {
35093509
"name": "Read Json",
35103510
"library": "pandas",
35113511
"description": "json to pandas object",
@@ -3585,7 +3585,7 @@ define([
35853585
}
35863586
]
35873587
},
3588-
"pd077": {
3588+
"pd_toJson": {
35893589
"name": "To Json",
35903590
"library": "pandas",
35913591
"description": "DataFrame/Series to Json file",
@@ -3636,7 +3636,7 @@ define([
36363636
}
36373637
]
36383638
},
3639-
"pd078": {
3639+
"pd_toPickle": {
36403640
"name": "To Pickle",
36413641
"library": "pandas",
36423642
"description": "DataFrame/Series to Pickle file",
@@ -3662,7 +3662,7 @@ define([
36623662
}
36633663
]
36643664
},
3665-
"pd079": {
3665+
"pd_readPickle": {
36663666
"name": "Read Pickle",
36673667
"library": "pandas",
36683668
"description": "Pickle to pandas object",
@@ -6515,7 +6515,7 @@ define([
65156515
}
65166516
]
65176517
},
6518-
"pd123": {
6518+
"pd_readExcel": {
65196519
"name": "Read Excel",
65206520
"library": "pandas",
65216521
"description": "excel to pandas object",
@@ -6551,7 +6551,7 @@ define([
65516551
},
65526552
]
65536553
},
6554-
"pd124": {
6554+
"pd_toExcel": {
65556555
"name": "To Excel",
65566556
"library": [
65576557
"pandas",
@@ -6699,7 +6699,91 @@ define([
66996699
]
67006700
}
67016701
]
6702-
}
6702+
},
6703+
"pd_readSas": {
6704+
"name": "Read Sas",
6705+
"library": "pandas",
6706+
"description": "Read SAS files stored as either XPORT or SAS7BDAT format files.",
6707+
"code": "${o0} = pd.read_sas(${i0}${format}${encoding}${etc})",
6708+
"options": [
6709+
{
6710+
"name": "i0",
6711+
"label": "File Path",
6712+
"required": true,
6713+
"type": "text",
6714+
"component": [
6715+
"file"
6716+
]
6717+
},
6718+
{
6719+
"name": "o0",
6720+
"label": "Allocate to",
6721+
"output": true,
6722+
"component": [
6723+
"data_select"
6724+
]
6725+
},
6726+
{
6727+
"name": "format",
6728+
"label": "Format",
6729+
"type": "text",
6730+
"component": [
6731+
"option_select"
6732+
],
6733+
"options": [
6734+
"",
6735+
"xport",
6736+
"sas7bdat"
6737+
],
6738+
"usePair": true
6739+
},
6740+
{
6741+
"name": "encoding",
6742+
"label": "Encoding",
6743+
"type": "text",
6744+
"usePair": true
6745+
}
6746+
]
6747+
},
6748+
"pd_readSpss": {
6749+
"name": "Read Spss",
6750+
"library": "pandas",
6751+
"description": "Load an SPSS file from the file path, returning a DataFrame.",
6752+
"code": "${o0} = pd.read_spss(${i0}${usecols}${convert_categoricals}${etc})",
6753+
"options": [
6754+
{
6755+
"name": "i0",
6756+
"label": "File Path",
6757+
"required": true,
6758+
"type": "text",
6759+
"component": [
6760+
"file"
6761+
]
6762+
},
6763+
{
6764+
"name": "o0",
6765+
"label": "Allocate to",
6766+
"output": true,
6767+
"component": [
6768+
"data_select"
6769+
]
6770+
},
6771+
{
6772+
"name": "usecols",
6773+
"label": "Use columns",
6774+
"usePair": true
6775+
},
6776+
{
6777+
"name": "convert_categoricals",
6778+
"label": "Convert categoricals",
6779+
"component": [
6780+
"bool_select"
6781+
],
6782+
"default": true,
6783+
"usePair": true
6784+
},
6785+
]
6786+
},
67036787
}
67046788

67056789
return {

visualpython/js/m_apps/File.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ define([
4242
'csv': 'csv',
4343
'excel': 'xlsx',
4444
'json': 'json',
45-
'pickle': ''
45+
'pickle': '',
46+
'sas': '', // xport or sas7bdat
47+
'spss': ''
4648
}
4749

4850
this.package = {
@@ -79,10 +81,12 @@ define([
7981
this.fileState = {
8082
'Read': {
8183
fileTypeId: {
82-
'csv': 'pd004',
83-
'excel': 'pd123',
84-
'json': 'pd076',
85-
'pickle': 'pd079'
84+
'csv': 'pd_readCsv',
85+
'excel': 'pd_readExcel',
86+
'json': 'pd_readJson',
87+
'pickle': 'pd_readPickle',
88+
'sas': 'pd_readSas',
89+
'spss': 'pd_readSpss'
8690
},
8791
selectedType: 'csv',
8892
package: null,
@@ -93,10 +97,10 @@ define([
9397
},
9498
'Write': {
9599
fileTypeId: {
96-
'csv': 'pd005',
97-
'excel': 'pd124',
98-
'json': 'pd077',
99-
'pickle': 'pd078'
100+
'csv': 'pd_toCsv',
101+
'excel': 'pd_toExcel',
102+
'json': 'pd_toJson',
103+
'pickle': 'pd_toPickle'
100104
},
101105
selectedType: 'csv',
102106
package: null,

visualpython/js/m_library/m_pandas/readFile.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ define([
5757
};
5858
this.fileState = {
5959
fileTypeId: {
60-
'csv': 'pd004',
61-
'excel': 'pd123',
62-
'json': 'pd076',
63-
'pickle': 'pd079'
60+
'csv': 'pd_readCsv',
61+
'excel': 'pd_readExcel',
62+
'json': 'pd_readJson',
63+
'pickle': 'pd_readPickle'
6464
},
6565
selectedType: 'csv',
6666
package: null

visualpython/js/m_library/m_pandas/toFile.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ define([
5757
};
5858
this.fileState = {
5959
fileTypeId: {
60-
'csv': 'pd005',
61-
'excel': 'pd124',
62-
'json': 'pd077',
63-
'pickle': 'pd078'
60+
'csv': 'pd_toCsv',
61+
'excel': 'pd_toExcel',
62+
'json': 'pd_toJson',
63+
'pickle': 'pd_toPickle'
6464
},
6565
selectedType: 'csv',
6666
package: null

0 commit comments

Comments
 (0)