佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1066|回复: 11

急~Help~我需要知道怎样用Python出command~T_T

[复制链接]
发表于 5-3-2008 12:03 AM | 显示全部楼层 |阅读模式
我已经install python, installed numpy and scipy.

我是一位初学者。

全都是靠自己学Python.
用它的目的是做学业功课。

请问有谁可以帮帮忙?
谢谢~

另外,可以pm我学Python的网站吗?
我最主要的是要学怎样写出loops or array or sigma summation自类.

这是我求救的Pythin Commands~~


回复

使用道具 举报


ADVERTISEMENT

发表于 5-3-2008 03:30 AM | 显示全部楼层
http://www.python.org/
数学很难搞的...
我只知道你一定要
import math
剩余的自己试试看吧!
也参考它的tutorial吧!
http://docs.python.org/tut/tut.html
回复

使用道具 举报

 楼主| 发表于 5-3-2008 05:21 PM | 显示全部楼层

回复 2# Sunyata 的帖子

谢谢你~^_^
不过我怕还是找不到sigma summation 的方法~
有人会吗?

本人感激不尽
回复

使用道具 举报

发表于 6-3-2008 11:57 AM | 显示全部楼层
你会 写 for loop 吗?
回复

使用道具 举报

 楼主| 发表于 6-3-2008 02:26 PM | 显示全部楼层

回复 4# tensaix2j 的帖子

我只会写C programming的for loops.
难道Python的for loops和 C programming的for loops的command写法是一样的?
回复

使用道具 举报

发表于 6-3-2008 05:26 PM | 显示全部楼层
原帖由 ~HeBe~_@ 于 6-3-2008 02:26 PM 发表
我只会写C programming的for loops.
难道Python的for loops和 C programming的for loops的command写法是一样的?


是蠻接近的。

sum=0
for sum in range(10):
     sum+=sum
print sum
回复

使用道具 举报

Follow Us
 楼主| 发表于 7-3-2008 12:54 AM | 显示全部楼层

回复 6# Sunyata 的帖子

谢谢你~
我若有问题我会放上来。。。
回复

使用道具 举报

发表于 13-3-2008 11:32 AM | 显示全部楼层
回复

使用道具 举报


ADVERTISEMENT

 楼主| 发表于 13-3-2008 10:09 PM | 显示全部楼层

回复 8# python_king 的帖子

谢谢你。
若我有个data, data是.txt file,data 里有300 observations (rows).
一个observation(row) 里的1st col有value y 和 2nd col有value theta.\
Exp for nth rows in the data:
0.0      -1.2
0.9      -0.8
1.8      -0.6
2.6      -0.3
3.5      0.1
4.5      0.1
5.4      0.3
6.2      0.5
7.1      0.9
8.0      1.2
8.9      1.3
9.8      1.2
...
...
nth rows
Actually got 300 rows (observation)

我有一个equation:  y = sin (theta) where 我的y value和theta value is given in the data provided.

问题是我read theta 和 y from data.
我已经用split command to split the all rows into 1st col and 2nd col.Then, use all 1st column of all 300 rows substitute into the equation, while use 2nd column of all 300 rows substitute into the equation too.

我要Plot a graph showing the data points as a function of the theta.

要怎样plot graph?

谢谢python_king
回复

使用道具 举报

发表于 14-3-2008 10:37 AM | 显示全部楼层
我不是Python高手,别让我的ID骗了
这里有一个sample (http://linuxgazette.net/145/john2.html),
留意那个sine的sample (http://linuxgazette.net/145/misc/john/sine.py)。
以上的sample是用PyX library的,这里是PyX自己的sample (http://pyx.sourceforge.net/examples/graphs/function.html)
回复

使用道具 举报

发表于 15-3-2008 03:29 AM | 显示全部楼层
原帖由 ~HeBe~_@ 于 13-3-2008 10:09 PM 发表
谢谢你。
若我有个data, data是.txt file,data 里有300 observations (rows).
一个observation(row) 里的1st col有value y 和 2nd col有value theta.\
Exp for nth rows in the data:
0.0      -1.2
0 ...

matplotlib, numpy
回复

使用道具 举报

 楼主| 发表于 21-3-2008 03:30 PM | 显示全部楼层

回复 8# python_king 的帖子

谢谢你~^_^
你的website对我有很大的帮助~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 1-1-2026 03:19 PM , Processed in 0.109998 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表