ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 06 May 2020 06:00:43 +0200Best way to read an external data filehttps://ask.sagemath.org/question/51294/best-way-to-read-an-external-data-file/ What is the best way to read an external data file and to have the datas in sagemath format ? Should I add an add-on ?CyrilleWed, 06 May 2020 06:00:43 +0200https://ask.sagemath.org/question/51294/Numerical and graphical summaries of datahttps://ask.sagemath.org/question/10030/numerical-and-graphical-summaries-of-data/I have been given the following data:
pcb138 pcb180 pcb52 pcb118 pcb
1 1.46 0.738 0.532 0.720 19.9959
2 0.64 0.664 0.030 0.236 6.0996
3 3.29 1.150 0.134 1.540 24.9655
4 3.94 1.330 0.466 1.940 37.4436
5 3.18 2.140 0.243 1.470 30.1830
6 2.43 1.300 0.137 1.310 20.8036
7 3.94 3.490 0.208 0.876 41.3818
8 3.38 1.040 0.477 2.460 29.4780
9 2.21 0.966 0.457 1.140 24.2387
10 2.49 1.590 0.298 1.180 26.3198
11 0.86 0.395 0.020 0.406 8.5910
12 3.38 1.850 0.539 1.500 36.4229
13 7.39 4.420 0.707 3.550 66.4108
14 2.74 0.595 0.893 1.980 30.5757
15 2.58 1.780 0.112 1.520 25.4771
16 7.28 3.490 1.440 4.000 68.5567
17 2.29 2.100 0.124 0.981 23.1381
18 5.35 5.370 0.154 0.737 43.0451
19 4.62 2.690 0.319 1.490 39.5300
20 3.54 1.140 0.536 1.890 36.5013
21 1.98 1.040 0.718 0.889 26.5255
22 2.01 1.040 0.173 1.500 22.1370
23 2.22 0.897 0.228 1.070 19.1992
24 3.50 2.330 0.456 1.520 32.9518
25 0.86 0.474 0.152 0.393 9.0893
26 4.92 3.650 0.181 1.790 42.0037
27 2.76 0.868 1.780 2.140 48.7727
28 5.18 3.610 0.843 2.390 55.8940
29 2.60 1.240 0.482 1.600 31.8021
30 4.95 2.740 1.290 2.350 60.1485
31 10.80 8.820 0.067 3.550 97.2793
32 2.02 1.390 0.311 1.310 18.3945
33 3.24 2.600 0.117 1.740 27.5003
34 8.22 7.070 0.531 2.560 79.0347
35 9.50 9.470 0.752 2.420 97.8119
36 4.88 2.690 0.304 2.600 44.8870
37 5.75 3.100 0.595 1.850 58.2125
38 5.48 5.460 0.352 1.540 57.4186
39 8.08 3.370 0.065 3.580 57.4938
40 3.29 2.370 0.340 1.350 33.5817
41 3.73 1.020 5.860 3.890 115.7361
42 1.36 0.624 0.269 0.508 14.8479
43 9.92 2.810 1.260 4.770 91.6305
44 8.65 6.210 0.428 3.680 92.1625
45 4.56 1.150 0.307 2.710 37.0122
46 8.78 4.690 0.892 3.850 87.6535
47 13.10 7.630 0.981 4.810 111.3631
48 5.99 3.060 0.062 2.640 47.9596
49 3.91 2.480 0.170 3.180 38.0747
50 6.51 1.470 7.750 5.450 122.7960
51 11.30 4.100 1.620 6.290 113.1166
52 8.12 3.990 0.867 3.490 79.2042
53 11.50 9.330 0.707 3.360 98.3269
54 3.99 2.100 0.328 1.410 33.0017
55 7.88 2.290 0.667 5.650 64.2417
56 13.00 5.040 2.130 6.900 119.3755
57 9.05 5.080 0.497 3.900 80.6768
58 21.00 19.000 0.645 3.660 171.4136
59 12.20 17.600 0.188 4.090 132.8670
60 8.63 3.110 1.780 6.090 91.7974
61 4.39 1.110 0.232 3.350 32.6213
62 5.95 3.630 0.953 2.910 59.5369
63 19.70 10.600 4.030 8.590 200.5094
64 7.60 3.730 0.351 5.000 65.3966
65 18.10 9.870 2.750 8.190 198.5225
66 13.10 4.490 0.538 6.860 89.3715
67 25.20 13.000 1.420 13.000 210.3284
68 12.30 3.750 9.060 18.900 246.6618
69 32.30 31.500 1.800 8.490 318.7461
What is the easiest way to compute the numerical and graphical summaries, describe the relationship of each pair of variables and describe the distribution of each of these variables in sage?Jaakko SeppäläTue, 16 Apr 2013 16:43:21 +0200https://ask.sagemath.org/question/10030/Save and retrieving my datahttps://ask.sagemath.org/question/11039/save-and-retrieving-my-data/I often compute things that take a lot of time. When I stop working, I have to turn off my laptop. When I resume my work later, I'd like to be able to retrieve the previous data, computations, etc. For instance, I have computed a big list and stored it to the variable `x`. I would like to be able to save my data including the contents of this variable, then when I resume my work, I'd like to be able to have `x` back.
I tried to save my data to a file `mydata.dat` via the *Data -->Upload or create file* menu. Then, I quit sage, ran it again, and tried to link the data file back via the same menu. I got the following:
> The data filename already exists in other worksheet Delete the file in the other worksheet before creating a link.
I don't really understand what that means. Then, I tried all of the following:
DATA+'mydata.dat'
open(DATA+'mydata.dat')
DATA=DATA+'mydata.dat'
but in any case, if I type x, I get
NameError: name 'x' is not defined
Could somebody tell me how I should achieve what I'm trying?
geo909Sat, 15 Feb 2014 17:36:12 +0100https://ask.sagemath.org/question/11039/Getting plot datahttps://ask.sagemath.org/question/10882/getting-plot-data/Is there a way to extract the set of values used in a plot using sage/python code?
For example, if I have 3D surface plot, what is the best way to get the set of vertices, or the z-values, for the mesh? (and similarly for 2d plots) I've looked through some of the plotting source code but haven't found a straightforward way to access the underlying plot data.
Any tips would be appreciated!rmp251Wed, 08 Jan 2014 23:01:13 +0100https://ask.sagemath.org/question/10882/Load data when running Sage from a VM in Windowshttps://ask.sagemath.org/question/10836/load-data-when-running-sage-from-a-vm-in-windows/Hi, is there a way to load data into Sage when I´m running it from a virtual machine in VirtualBox and the data is in Windows? Thanks.AntonioMon, 16 Dec 2013 16:43:00 +0100https://ask.sagemath.org/question/10836/How to input data in SAGE and deal with themhttps://ask.sagemath.org/question/10686/how-to-input-data-in-sage-and-deal-with-them/I wish to calculate the width of the certain polytopes, the data for these polytopes can be found [here](http://hep.itp.tuwien.ac.at/~kreuzer/CY/) (please click "K3/3d" on the left, and then click "list of all 4319" on the top of new page, for some reason, I could not cite the exact URL).
For example, the first one is
3 4 M:5 4 N:35 4 Pic:19 Cor:0
1 0 0 -1
0 1 0 -1
0 0 1 -1
However, only the number in the matrix will be used in the calculation. My questions are:
(1) How to input these data in SAGE (I use a windows system, and run Virtualbox for SAGE)?
(2) How to use sage to deal with each matrix?
For each of matrix, I have a program as the follows
sage: m = matrix(ZZ, [[1,0,0,-1],
....: [0,1,0,-1],
....: [0,0,1,-1]])
sage: p = LatticePolytope(m)
sage: d = p.distances()
sage: l = p.nfacets()
sage: for i in range(l):
....: max(d.row(i))
After input the data, how to let sage use the same program deal with each matrix?
Thank you very much for your help!!!Li YutongSat, 02 Nov 2013 21:20:45 +0100https://ask.sagemath.org/question/10686/Compatible data file formatshttps://ask.sagemath.org/question/10300/compatible-data-file-formats/What are the compatible file formats if I want to load a data set into Sage? I know that I can load .*csv* files using Python's csv module or *open()* method.
Is there any **other file format** that I can use in Sage?
ThanksTharindu RusiraSun, 30 Jun 2013 16:20:45 +0200https://ask.sagemath.org/question/10300/upload data file to notebookhttps://ask.sagemath.org/question/8639/upload-data-file-to-notebook/Hello!
I have a data file on my hard drive which I can open like:
open('/path/to/file')
in case of sage's server can access this file. But if the server is on the remote machine and there is no way to share a file between my machine and the server, can I somehow upload this file via web-interface to the sage notebook server and then open it and read it?EugeneWed, 18 Jan 2012 03:56:53 +0100https://ask.sagemath.org/question/8639/Setup multiple sage webservers to access the same datahttps://ask.sagemath.org/question/9925/setup-multiple-sage-webservers-to-access-the-same-data/Hello,
We don't have a one super powerful machine in the lab to run sage webserver. If we have several users running scripts on the sage webserver at the same time, it will probably overload the machine. So we would like to setup webserver on local machines (by installing sage locally on each machine). But we would like all sage installations to access the same set of data. Preferably the data will reside elsewhere on our main server machine. Where can I find documentation to set sage up in that manner?
Thanks
-simon Simon SuTue, 19 Mar 2013 16:46:14 +0100https://ask.sagemath.org/question/9925/Empirical Data Plothttps://ask.sagemath.org/question/9914/empirical-data-plot/I wish to make a plot of N vs Time where $N=$ # of edges in a graph.
i.e. i want to make an empirical estimate of the time complexity it takes to compute certain things about a graph based on its number of edges.
so i guess i'm wanting to know how i can plot these data points in sage and find a polynomial that best fits?
i.e.
N = [(16,28,59,120)]
T = [(0.135,0.523,7.36,248)] --where time is measured in seconds
i'm a beginner so any help will be much appreciated.jtaaFri, 15 Mar 2013 08:07:41 +0100https://ask.sagemath.org/question/9914/How to output data to a filehttps://ask.sagemath.org/question/9703/how-to-output-data-to-a-file/Here is my code that graphs a function:
z1=2*pi*650*10^6
p1=2*pi*1.95*10^9
p2=2*pi*5*10^9
adc=.667
deltaF=.1*10^9
N=(adc*p1*p2)/z1
M(freq)=(2*i*pi*freq+z1)/((2*i*pi*freq+p1)*(2*i*pi*freq+p2))
Z=abs(N*M(freq))
g(freq)=20*log(Z,10)
pts=[(freq,g(freq).n()) for freq in srange(10^8,10^11,deltaF)]
list_plot(pts, plotjoined=True, scale='semilogx', gridlines="minor", ymin=-25, ymax=5)
How do I output this data to a file so I can compare it to data generated by another piece of software?
gjmFri, 11 Jan 2013 11:52:02 +0100https://ask.sagemath.org/question/9703/How to plot data from a file?https://ask.sagemath.org/question/9393/how-to-plot-data-from-a-file/Is it possible to plot data imported from an ASCII file.npaFri, 05 Oct 2012 06:28:03 +0200https://ask.sagemath.org/question/9393/more complicated data types to/from sage from/to C functionshttps://ask.sagemath.org/question/9242/more-complicated-data-types-tofrom-sage-fromto-c-functions/Hi.
Its easy to pass simple format data like double, int between sage and C programs.
int add_one(int i)
{
return i+1;
}
than
cdef extern from "file":
int add_one(int n)
but what if i want to pass list, tuples etc ( simple int * doesnt work ;) )
Does anybody know how to do that, or if thher is samoe manual (in this what i found are only simple examples )
Thank You in advance
Luke
blurrppThu, 16 Aug 2012 06:10:07 +0200https://ask.sagemath.org/question/9242/comple data types pasing to/form sage fotm/to Chttps://ask.sagemath.org/question/9243/comple-data-types-pasing-toform-sage-fotmto-c/Hi.
Its easy to pass simple format data like double, int between sage and C programs.
int add_one(int i)
{
return i+1;
}
than
cdef extern from "file":
int add_one(int n)
but what if i want to pass list, tuples etc ( simple int * doesnt work ;) )
Does anybody know how to do that, or if thher is samoe manual (in this what i found are only simple examples )
Thank You in advance
Luke
blurrppThu, 16 Aug 2012 06:11:01 +0200https://ask.sagemath.org/question/9243/how to smooth data ?https://ask.sagemath.org/question/8153/how-to-smooth-data/I tried to use [Scipy/numpy example code](http://www.scipy.org/Cookbook/SignalSmooth) for smoothing the data. The code didnt work for me. Also I couldnt find a command in Sage. What should I do ? b0f00narchWed, 08 Aug 2012 16:13:55 +0200https://ask.sagemath.org/question/8153/Math structures convertershttps://ask.sagemath.org/question/9169/math-structures-converters/Hi all,
I am a newbie here, and I am doing some experiments with SAGE. I am trying to tie up a kind of computing framework that could import data from some kind of sources, invoke generic algorhitms, and render output data.
SAGE and SAGENB are great works, thanks for developing them!
I see that SAGE can operate on many backends, but I can't figure out if it can convert data from one backend to another.
More explanation:
I have to take care mainly of Matlab syntax in this stage, but I'd like to save data in Python or a Scipy structure after import, and then perform conversion of data basing on the computing or rendering algorithm the user choose. Is it feasible with any library you developed or you know?
The "b plan" could be to use the Octave syntax which is 100% compatible. Am I right?
Respect to this question there are also performance,data size grow issues and maybe other to consider.
I hope this is the right place to post this question.
Thank you in advance
LucaferoSun, 22 Jul 2012 04:51:01 +0200https://ask.sagemath.org/question/9169/Download Data folderhttps://ask.sagemath.org/question/9051/download-data-folder/Hi!
I'm trying to download all the data folder of a worksheet. I see the GUI permits you to download it one single file at once. I have many files (about 2000 files), and I'm unable to download all the folder at once. I'm using VirtualBox at Windows and it's Sage 5.0 version.
How can I do it?
Thank you! :)RoctivFri, 08 Jun 2012 17:46:57 +0200https://ask.sagemath.org/question/9051/Integrated data upload.https://ask.sagemath.org/question/9046/integrated-data-upload/I'd like to have something like the [single cell server](http://aleph.sagemath.org/) has when you click the 'advanced' button. I tried simply copying the html from the save/upload data page, but I get the error:
Error uploading file (missing url arg).
I can't seem to find the necessary html/javascript on the single cell server.
What I tried to use, except with <'s and \n\'s deleted:
html('div>
form method="POST" action="do_upload_data"
name="upload" enctype="multipart/form-data">
div>
label for="file">Browse your computer to select a file to upload:</label>
input size="50" type="file" name="file" />
</div>
div>
label for="name">What do you want to call it? (if different than the original name)</label>
input size="50" type="text" name="name" />
</div>
button type="submit">Upload or Create Data File</button>
</form>
</div>')ooglybooglyFri, 08 Jun 2012 12:46:58 +0200https://ask.sagemath.org/question/9046/How to make a boxplot in Sage?https://ask.sagemath.org/question/8998/how-to-make-a-boxplot-in-sage/How do you make a boxplot in Sage given a dataset?paldepindThu, 24 May 2012 07:22:03 +0200https://ask.sagemath.org/question/8998/how to enter a list of data points in an interact?https://ask.sagemath.org/question/8799/how-to-enter-a-list-of-data-points-in-an-interact/I want to enter a default list of (x,y) data for a scatter plot that the user can modify to create a different scatter plot.dasmith88Tue, 20 Mar 2012 12:15:02 +0100https://ask.sagemath.org/question/8799/Plotting spherical datahttps://ask.sagemath.org/question/8448/plotting-spherical-data/I'd like to know how to plot spherical data in a 3D plot (or to request this feature).
Basically, I have a list of data points in spherical coordinates which represent an antenna pattern. I'd like to plot them and have it look something like this:
http://i.imgur.com/35Lyh.png
My data is only taken every 15 degrees. So I can't do something like this person did:
http://ask.sagemath.org/question/512/plotting-in-3d-in-spherical-coordinates
The reason is that if I create a continuous interpolated function I'd be fabricating data (unless I can re-create a picture like the one above closely).
Ideally a spherical list plot would be ideal, but it seems like the current list plot is only cartesian.
After I successfully get my data plotted, the next steps for my antenna plot viewer would be
1) Make the color map scale set-able (so that multiple antenna plots have colors on the same scale, even if data ranges are different).
2) Make grid-lines visible, like on my picture above.
3) Apply a bicubic interpolation to my data mesh, so it would then look like this (for visual purposes): http://i.imgur.com/U4hPW.png
4) Make the xyz axes visible, like the pic.
All these seem pretty easy, except maybe #2, if anyone knows how that could be done it would be greatly appreciated.
Thanks so much everyone for working on this software. I look forward to this becoming a great tool for engineers and scientists. JasonMon, 07 Nov 2011 01:49:06 +0100https://ask.sagemath.org/question/8448/How do I create a log plot of line data?https://ask.sagemath.org/question/8243/how-do-i-create-a-log-plot-of-line-data/Is there a good way to create a log-log plot of line data in sage? I can't find it through the plot or line interfaces. tcfisherTue, 26 Jul 2011 18:54:24 +0200https://ask.sagemath.org/question/8243/Plotting and Fittinghttps://ask.sagemath.org/question/7909/plotting-and-fitting/Hi, I have to learn to plot and fit functions (with error bars in x and y direction).
My question is: **1**) Can I do it with sage? Would you prefer gnuplot?
How can I read and plot data like this: http://rn0.ru/show/1430/ easily in sage?
**2**) And if yes how?
I already tried to plot some randomly created data: http://rn0.ru/show/1429/ And that works great.
**3**) How can I fit a function (nonlinear) with considering the errorbars?
manifoldFri, 28 Jan 2011 12:07:37 +0100https://ask.sagemath.org/question/7909/Data files on public servers accesshttps://ask.sagemath.org/question/7866/data-files-on-public-servers-access/Hello!
I use public Sage servers from time to time and I have a question about their work.
For example, let's imagine I created a sheet which got a number 3. The corresponding folder with the same name is created on the server's hard disk. Then all what I do on that sheet is stored in that folder, right?
- If I want to store some data into a file or to create a text file with some table in it to use it further with other software, those files are also stored in the folder "3", right? If so, then can these files be accessed to only from this sheet or from another my sheets too?
- Who is the owner of such files? As far as I understand, when I open any one of my sheets, a new user is logged into a system and all the files created by this user during this session belong to this user.
- Can other users access my files if they get the same username under which I had saved those files?v_2eThu, 13 Jan 2011 09:09:11 +0100https://ask.sagemath.org/question/7866/Notebook List Object Data Storage/Retrieval? (Start/Restart)https://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/How do you best store list data (between stopping and restarting notebook sessions) when there's too much for the notebook to handle as repr() output (when re-parsed upon re-evaluation)?ccanoncWed, 18 Aug 2010 23:07:18 +0200https://ask.sagemath.org/question/7558/I need help with Sagetex/Sage (normal form&data file useage)https://ask.sagemath.org/question/7739/i-need-help-with-sagetexsage-normal-formdata-file-useage/Greetings!
I have two questions.
The easier is, how can i "ask" Sagemath to numerically calculate, and use normal form. For example i would like to see sqrt{2}/10 as 1.41 * 10^{-1}. It would be useful to always get the same precision. Like 2/10 as 2.00 * 10^{-1}
The harder question is, i want to make several calculations with the same data (about 10-20 lines, every line with 2-4 records). It is possible to copy and paste it every time, but i rather do it an easier way. Is it possible?
DanielDaniel BalogWed, 27 Oct 2010 19:19:13 +0200https://ask.sagemath.org/question/7739/