pip timeout/unrar/pd.read_sql

pip --default-timeout=100 install pandas -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
# wget http://www.rarlab.com/rar/rarlinux-x64-5.0.0.tar.gz

# tar -zxvf rarlinux-x64-5.0.0.tar.gz

# mv rar /opt/

# cd /opt/rar/

# make && make install
import pandas as pd
 
with sqlite3.connect('test_database.sqlite') as con:
 
  # read_sql_query和read_sql都能通过SQL语句从数据库文件中获取数据信息
  df = pd.read_sql_query("SELECT * FROM test_table", con=con)
  # df = pd.read_sql("SELECT * FROM test_table", con=con)
 
  print(df.shape)
  print(df.dtypes)
  print(df.head())

你可能感兴趣的:(python)