18.scrapy_maitian_analysis
1_info.py # encoding: utf-8 import pandas as pd # 租房 基本信息 # 读取文件 df=dataframe df = pd.read_json("zufang.json") # print(df) # print(df.columns) # 使用pandas的describe方法,打印基本信息 print(df.describe()) # 按照区,分别统计个数 print(df["district"].value_counts()) # print('**************************') # # 二手房 基本信息 df = pd.read_json("ershoufang.json") print(df.describe()) # 分别统计个数 print(df["district"].value_counts()) 2_pie_chart.py # coding:utf-8 import numpy as np import pandas as pd import json import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties from pylab