分类目录归档:Python

Pandas与SQL对比


与SQL比较

大多数示例将使用tipspandas测试中找到的数据集。我们将数据读入名为tips的DataFrame中,并假设我们有一个具有相同名称和结构的数据库表。

In [3]: url = ('https://raw.github.com/pandas-dev'
   ...:        '/pandas/master/pandas/tests/data/tips.csv')
   ...: 

In [4]: tips = pd.read_csv(url)

In [5]: tips.head()
Out[5]: 
   total_bill ...

Read more

Django常用Import模块


#用户相关
from django.contrib.auth import models
from django.contrib.auth import authenticate
from django.contrib.auth.models import Group,User

#Model,Admin,Form, Url中需引用
from django.conf import settings
from django.db import models
from django.contrib import admin
from django import forms
from djan...

Read more

python常用的命令行操作


Python安装

useradd username -g usergroup
wget https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh
https://repo.continuum.io/archive/index.html
./Anaconda3-5.3.0-Linux-x86_64.sh
# vi ~/.bashrc
source ~/.bashrc
# 包安装方法
pip install --upgrade pip
pip show Jinja2
pip list
pip install some....

Read more