Ask Your Question

psp's profile - activity

2022-09-24 17:01:23 +0200 received badge  Nice Question (source)
2020-08-28 23:10:32 +0200 received badge  Famous Question (source)
2020-03-16 22:48:03 +0200 received badge  Popular Question (source)
2020-03-16 22:48:03 +0200 received badge  Notable Question (source)
2020-03-16 22:48:03 +0200 received badge  Famous Question (source)
2019-09-24 21:23:19 +0200 received badge  Popular Question (source)
2019-09-24 21:23:19 +0200 received badge  Notable Question (source)
2019-02-20 19:08:31 +0200 received badge  Student (source)
2017-08-18 19:30:48 +0200 answered a question import CSV in python using jupyter notebook on cocalc cloud

I found it! Just upload the file in the same folder of the project, and then you can refer to it just with its name and extension, without any other address specification. So in my specific case:

dataset = pandas.read_csv('name_of_file.extension', names=names)

and it works greatly. Remember to use ' ' inside which you should specifies the file name

2017-08-18 19:30:48 +0200 commented answer solving a physic problem using sage

Mmm, let me do some checks. Anyway your answer seems very interesting!

2017-08-18 19:30:48 +0200 asked a question import CSV in python using jupyter notebook on cocalc cloud

I want to import this https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data (CVS file) in my python script with the commands:

url = "https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data"
names = ['sepal-length', 'sepal-width', 'petal-length', 'petal-width', 'class']
dataset = pandas.read_csv(url, names=names)

The problem is that it returns this error message:


URLError Traceback (most recent call last) <ipython-input-21-45b1e7974739> in <module>() 32 url = "https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data" 33 names = ['sepal-length', 'sepal-width', 'petal-length', 'petal-width', 'class'] ---> 34 dataset = pandas.read_csv(url, names=names)

/projects/sage/sage-7.6/local/lib/python2.7/site-packages/pandas/io/parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, skipfooter, skip_footer, doublequote, delim_whitespace, as_recarray, compact_ints, use_unsigned, low_memory, buffer_lines, memory_map, float_precision) 653 skip_blank_lines=skip_blank_lines) 654 --> 655 return _read(filepath_or_buffer, kwds) 656 657 parser_f.__name__ = name /projects/sage/sage-7.6/local/lib/python2.7/site-packages/pandas/io/parsers.py in _read(filepath_or_buffer, kwds) 390 compression = _infer_compression(filepath_or_buffer, compression) 391 filepath_or_buffer, _, compression = get_filepath_or_buffer( --> 392 filepath_or_buffer, encoding, compression) 393 kwds['compression'] = compression 394 /projects/sage/sage-7.6/local/lib/python2.7/site-packages/pandas/io/common.py in get_filepath_or_buffer(filepath_or_buffer, encoding, compression) 184 if _is_url(filepath_or_buffer): 185 url = str(filepath_or_buffer) --> 186 req = _urlopen(url) 187 content_encoding = req.headers.get('Content-Encoding', None) 188 if content_encoding == 'gzip': /projects/sage/sage-7.6/local/lib/python/urllib2.pyc in urlopen(url, data, timeout, cafile, capath, cadefault, context) 152 else: 153 opener = _opener --> 154 return opener.open(url, data, timeout) 155 156 def install_opener(opener): /projects/sage/sage-7.6/local/lib/python/urllib2.pyc in open(self, fullurl, data, timeout) 427 req = meth(req) 428 --> 429 response = self._open(req, data) 430 431 # post-process response /projects/sage/sage-7.6/local/lib/python/urllib2.pyc in _open(self, req, data) 445 protocol = req.get_type() 446 result = self._call_chain(self.handle_open, protocol, protocol + --> 447 '_open', req) 448 if result: 449 return result /projects/sage/sage-7.6/local/lib/python/urllib2.pyc in _call_chain(self, chain, kind, meth_name, args) 405 func = getattr(handler, meth_name) 406 --> 407 result = func(args) 408 if result is not None: 409 return result /projects/sage/sage-7.6/local/lib/python/urllib2.pyc in https_open(self, req) 1239 def https_open(self, req): 1240 return self.do_open(httplib.HTTPSConnection, req, -> 1241 context=self._context) 1242 1243 https_request = AbstractHTTPHandler.do_request_ /projects/sage/sage-7.6/local/lib/python/urllib2.pyc in do_open(self, http_class, req, **http_conn_args) 1196 except socket.error, err: # XXX what error? 1197 h.close() -> 1198 raise URLError(err) 1199 else: 1200 try: URLError: <urlopen error="" [errno="" 110]="" connection="" timed="" out="">

What's the problem? How could I solve? I use a free account on CoCalc. If it takes time to upload and so not enough for my free account, how I can upload the file as worksheet and link it? What will be the link in the URL specification?

Thanks

2017-03-23 14:52:03 +0200 commented answer manipulation of parameter in a plot 2d function

Great! Sorry, I've not found it before.

2017-03-23 13:05:44 +0200 received badge  Scholar (source)
2017-03-22 13:49:37 +0200 commented question solving a physic problem using sage

After years, someone else could suggest a solution with Sage?

2017-03-22 13:49:15 +0200 asked a question manipulation of parameter in a plot 2d function

In Mathematica is possible to plot a function of variables and parameters, giving the possibility to have a slider to change interactively the parameter values. For example this input Manipulate[Plot[1-a/x, {x, 0, 10}], {a, 0, 20}] outputs the plot of the function 1-a/x, where x is the variable, so values are on the x-axis, and a is a parameter and it's exact value is set on a slide bar, between 0 and 20, that appears with running. I tried to do that with Sage, using the @interact possibility but I cannot find a solution for that. Could someone help me?

2014-06-29 21:46:19 +0200 received badge  Popular Question (source)
2014-06-29 21:46:19 +0200 received badge  Famous Question (source)
2014-06-29 21:46:19 +0200 received badge  Notable Question (source)
2013-12-17 13:13:31 +0200 commented question solving a physic problem using sage

Help!!Help!!Help!!

2013-10-29 10:28:34 +0200 commented answer physics problem solving with differential equations

No one could help me anyway? Just suggestions? Nothing?

2013-10-24 20:11:40 +0200 received badge  Supporter (source)
2013-10-24 13:30:59 +0200 commented answer physics problem solving with differential equations

no one could help me? Is it to difficult this problem?

2013-10-23 11:59:55 +0200 commented question solving a physic problem using sage

Is my problem too difficult to set on Sage that no one could help me?

2013-10-22 12:54:47 +0200 commented question solving a physic problem using sage

No one can help me???

2013-10-18 14:38:20 +0200 received badge  Editor (source)
2013-10-18 14:33:59 +0200 asked a question solving a physic problem using sage

Hi, I'm new in this community.

I want to solve a physic problem which requires differential equation system solutions.

I don't know if my equations are correctly set. Any suggestion is good. My problem is described by this image: http://img805.imageshack.us/img805/70...

I have two masses (1/3m the first, 2/3m the second) linked with a rope. The rope is free to slide around a nail (the big black point in the image). The image shows the starting condition: a man keeps the first mass stopped and so the rope is kept stretched by the second mass.

I search three functions describing the kinematics of two masses after the man will leave the fist mass: vertical movement of mass A y(t), vertical movement of mass B j(t), and horizontal movement of mass B x(t).

My Cartesian reference system is x-y system in the image.

I have to solve the following equations:

  1. $-\frac{2}{3}mg+T=\frac{2}{3}m \frac{d^2y}{dt^2}$
  2. $-\frac{1}{3}mg+S_y=\frac{1}{3}m\frac{d^2j}{dt^2}$
  3. $S_x=\frac{1}{3}m\frac{d^2x}{dt^2}$
  4. $|T|=\sqrt{S_x^2+S_y^2}$
  5. $|y(t)|=\sqrt{x(t)^2+j(t)^2}$

From the forth and the fifth equations I obtain two equations, so I have 5 equations in 5 unknowns. They are:

1) T force sustaining the second mass

2) Sx x-component of force sustaining the first mass

3) Sy y-component of force sustaining the first mass

4) y(t) position of the second mass

5) x(t) x-position of the first mass

6) j(t) y-position of the first mass

I hope my explanation is clear.

How can I obtain my solutions using Sage?

Thank you very much!!