Ask Your Question

stan's profile - activity

2024-04-25 13:06:19 +0200 received badge  Notable Question (source)
2024-04-25 13:06:19 +0200 received badge  Popular Question (source)
2024-02-06 20:16:26 +0200 received badge  Famous Question (source)
2023-03-06 02:39:14 +0200 marked best answer Use system-wide installation of graphviz in sage?

I am trying to install pygraphviz in sage 7.3 on a Debian jessy machine, but it already fails at: sage -i graphviz

================================ WARNING =================================
You are about to download and install an unmaintained experimental
package. This probably won't work at all for you! There is no guarantee
that it will build correctly, or behave as expected. Use at your own risk!

This package will be removed in future versions of SageMath. If you care
about this package, you should make a proper new-style package instead.
For more information about making Sage packages, see
http://doc.sagemath.org/html/en/developer/packaging.html
==========================================================================

I don't want to break sage, so I am wondering if there is a way to make sage use the system-wide installation of pygraphviz instead.

2023-03-06 02:38:33 +0200 received badge  Famous Question (source)
2023-02-15 13:45:00 +0200 received badge  Famous Question (source)
2022-06-12 14:09:09 +0200 received badge  Popular Question (source)
2022-02-01 04:21:57 +0200 received badge  Notable Question (source)
2022-01-13 07:21:05 +0200 received badge  Famous Question (source)
2021-12-07 12:26:14 +0200 received badge  Famous Question (source)
2021-11-09 12:23:57 +0200 received badge  Famous Question (source)
2021-07-22 16:35:10 +0200 received badge  Famous Question (source)
2021-02-20 03:51:18 +0200 received badge  Notable Question (source)
2020-10-29 04:34:23 +0200 received badge  Famous Question (source)
2020-09-25 16:06:21 +0200 received badge  Famous Question (source)
2020-07-16 04:20:14 +0200 received badge  Popular Question (source)
2020-07-09 11:50:09 +0200 received badge  Notable Question (source)
2020-06-12 11:53:04 +0200 received badge  Popular Question (source)
2020-06-12 11:53:04 +0200 received badge  Notable Question (source)
2020-04-17 01:11:51 +0200 received badge  Famous Question (source)
2020-02-27 17:33:28 +0200 received badge  Famous Question (source)
2020-02-18 17:29:55 +0200 received badge  Notable Question (source)
2020-01-29 22:43:42 +0200 received badge  Notable Question (source)
2019-12-23 01:55:38 +0200 received badge  Notable Question (source)
2019-12-21 17:01:43 +0200 received badge  Popular Question (source)
2019-12-03 00:01:00 +0200 received badge  Popular Question (source)
2019-10-26 22:59:51 +0200 received badge  Famous Question (source)
2019-06-25 21:03:09 +0200 received badge  Notable Question (source)
2019-05-03 15:28:14 +0200 received badge  Notable Question (source)
2019-04-24 20:01:46 +0200 received badge  Popular Question (source)
2019-04-05 11:53:40 +0200 received badge  Notable Question (source)
2019-01-27 22:42:19 +0200 received badge  Notable Question (source)
2019-01-08 06:50:08 +0200 received badge  Popular Question (source)
2018-12-25 12:23:47 +0200 received badge  Nice Answer (source)
2018-12-25 12:22:58 +0200 received badge  Popular Question (source)
2018-12-25 12:22:58 +0200 received badge  Notable Question (source)
2018-09-25 03:45:49 +0200 received badge  Popular Question (source)
2018-08-24 02:04:54 +0200 received badge  Notable Question (source)
2018-08-13 23:44:26 +0200 received badge  Popular Question (source)
2018-07-18 15:03:00 +0200 received badge  Popular Question (source)
2018-07-13 01:09:41 +0200 received badge  Famous Question (source)
2018-07-13 01:09:41 +0200 received badge  Notable Question (source)
2018-06-05 22:56:32 +0200 marked best answer sage vs. python integers and floats in pandas, matplotlib etc.

I have run into a problem before, where e.g. matplotlib did not like sage floats as input for axes ranges and I had to wrap them all in np.float(). Now I found a similar problem with pandas:

import pandas as pd  
fname = 'blah.xlsx'  
data_inf = pd.read_excel(fname)
# This works:
print data_inf[:int(3)]
# This does not:
print data_inf[:3]

TypeError: cannot do slice indexing on <class 'pandas.indexes.range.RangeIndex'> with these indexers [3] of <type 'sage.rings.integer.Integer'>

Is there a way to set up proper parsing for the worksheet at the onset, so that I don't have to wrap numbers and variables in the specific type needed by the respective function every time?

Thanks for your help!

2018-06-01 04:59:47 +0200 received badge  Nice Answer (source)
2018-03-30 16:57:38 +0200 received badge  Nice Answer (source)
2018-03-30 13:25:55 +0200 received badge  Self-Learner (source)
2018-03-30 11:12:22 +0200 answered a question best way to convert many notebooks from sagenb to jupyter?

Certainly not the best way, but here is how I did it using the answer of @eric_g:

In a terminal, show a list of all notebooks:

sage -n export --list

Copy the output into the clipboard and paste into a text editor that allows block selection, e.g. geany in linux. Then create a new directory (e.g. 'fromsagenb') to make sure that you don't overwrite existing files and copy the block just containing the names into a new file in the empty folder, e.g. 'list.txt'.

Now execute the following code to convert all sage notebooks in that list into jupyter notebooks:

import os
os.chdir('/path_to_fromsagenb/')
f = open('list.txt')
str1 = f.read()
str2 = str1.splitlines()
for name in str2:
    command = '~/Programs/SageMath/sage -n export --ipynb={0}.ipynb {0}'.format(name)
    os.system(command)
2018-03-30 10:32:13 +0200 commented answer best way to convert many notebooks from sagenb to jupyter?

Thanks, but sage -n export --list returns a table that looks pretty ugly in a text file: 'Unique ID | Notebook Name\n-------------------------------------------------------------------------------\n_sage_:0 | doc_browser_0\n_sage_:1 | doc_browser_0\n_sage_:2 | doc_browser_0\n_sage_:3 | doc_browser_0\n_sage_:4 and so on. Any idea how to get a list of tuples such as [('admin:11', 'output11'), ('admin:12', 'output12')]?

2018-03-21 14:36:13 +0200 asked a question best way to convert many notebooks from sagenb to jupyter?

I moved from sagenb to jupyter a while ago, but I still have a large number of sagenb notebooks that I have been converting one-by-one on demand. Is there a way to convert all of them at once and save them to a dedicated folder? Currently, when I start sage -notebook, I get to an interface where I can see all my sagenb notebooks and I have the option to click on any of them, convert and open in jupyter. I would actually like to convert all of them without opening them. This is related to https://ask.sagemath.org/question/358..., but I suppose that there is a better way now. Thanks already for your help!

2018-02-16 00:32:08 +0200 received badge  Famous Question (source)