Lydia's notes

Tips about Python and Linux.

Lydia's notes

Jupyter Notebook

Reference http://docs.sunpy.org/en/stable/guide/acquiring_data/jsoc.html

1
2
3
4
5
6
7
8
9
10
11
12
%load_ext autoreload
%autoreload 2

import astropy.units as u

from sunpy.net import Fido, attrs

# Suppress warnings of pandas, astropy
import warnings
warnings.simplefilter("ignore", category=FutureWarning)
from astropy.utils.exceptions import AstropyDeprecationWarning
warnings.simplefilter("ignore", category=AstropyDeprecationWarning)

To be clear, here we use

1
from sunpy.net import Fido, attrs
instead of examples in http://docs.sunpy.org/en/stable/guide/acquiring_data/jsoc.html
1
from sunpy.net import Fido, attrs as a
Read more »

Jupyter Notebook FITS Data

Anaconda

A conda package is a compressed tarball file that contains system-level libraries, Python or other modules, executable programs and other components. Conda keeps track of the dependencies between packages and platforms.
(https://conda.io/docs/user-guide/concepts.html)

  • 凡使用 pip install 安装的包均为编译安装, conda install 安装的则为编译好的二进制包.
  • conda 包可以打包其他语言, pip 包容易出现系统依赖问题
  • conda 包的依赖管理更完善
  • conda 环境下仍可使用 pip 进行安装, 但所使用的 pip 命令和系统中的 pip 互不影响, 安装的包的位置也在 conda 本身的目录下.
  • 每个环境互不影响, 各环境下的包虽然必须分别安装 (也可以 clone 一个现有环境),
    但如果有不同环境中有重复的包 conda 将默认使用 hard link.

(更多讨论参考 https://jakevdp.github.io/blog/2016/08/25/conda-myths-and-misconceptions/)

Read more »

Jupyter Notebook FITS Data

简介

优势: 开源, 用户广, 用途广, 社区完善, 新手友好

https://www.jetbrains.com/research/python-developers-survey-2017/

2017年的 python 使用调查报告 https://www.jetbrains.com/research/python-developers-survey-2017/

参考网站:


获取 python 包/模块/函数的帮助:

1
2
# python
>>> help(name)
1
2
3
# shell
$ pydoc <name>
$ pydoc -w <name> # 生成一个 html 帮助文件
1
2
# ipython/jupyter
name? # 弹出帮助文档, `Esc` 退出文档
Read more »
0%