Skip to content

Commit 65c6ae5

Browse files
committed
Change default script
1 parent 4dfc1ee commit 65c6ae5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Orange/widgets/data/owpythonscript.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636
__all__ = ["OWPythonScript"]
3737

3838

39+
DEFAULT_SCRIPT = """import numpy as np
40+
from Orange.data import Table, Domain, ContinuousVariable
41+
42+
arr = np.random.rand(3,3)
43+
domain = Domain([ContinuousVariable(i) for i in ['one', 'two', 'three']])
44+
out_data = Table.from_numpy(domain, arr)
45+
"""
46+
3947
def text_format(foreground=Qt.black, weight=QFont.Normal):
4048
fmt = QTextCharFormat()
4149
fmt.setForeground(QBrush(foreground))
@@ -423,8 +431,8 @@ class Outputs:
423431

424432
settings_version = 2
425433
scriptLibrary: 'List[_ScriptData]' = Setting([{
426-
"name": "Hello world",
427-
"script": "print('Hello world')\n",
434+
"name": "from_numpy",
435+
"script": DEFAULT_SCRIPT,
428436
"filename": None
429437
}])
430438
currentScriptIndex = Setting(0)

0 commit comments

Comments
 (0)