-
-
程序猿 初学数据Lv2
发表于2018-9-6 09:35
楼主
本帖最后由 程序猿 于 2018-9-6 09:39 编辑
复制代码
附详情代码:
复制代码
复制代码
复制代码
作者|丁彦军
昨天还幻想海边别墅的年轻人,今天可能开始对房租绝望了。
8月初,有网友在“水木论坛”发帖控诉长租公寓加价抢房引起关注。据说,一名业主打算出租自己位于天通苑的三居室,预期租金7500元/月,结果被二方中介互相抬价,硬生生抬到了10800。
过去一个月,全国热点城市的房租如脱缰野马。一线的房租同比涨了近20%。一夜醒来,无产青年连一块立锥之地都悬了。
从2018下半年开始,租金海啸汹汹来袭,资本狂欢,官方默然,房东纠结,租客尖叫。
这不是一方的过错,而更像是一场全社会的“集体谋杀作品”。最令人不安的是,过去房地产的那套玩法和上涨逻辑,今天正在转移到房租上。
房租暴涨的不只是北京。有数据显示,7月份北京、上海、广州、深圳、天津、武汉、重庆、南京、杭州和成都十大城市租金环比均有所上涨。其中北京、上海、深圳的租金涨幅最猛,北京7月份房租同比上涨3.1%,有小区甚至涨幅超过30%。

图自“21世纪经济报道”《最新房租数据出炉,你一个月要交多少钱?(附房租地图)》一文
接下来,本文使用 Python 大法通过获取某网数万条北京租房数据,给大家说说真实的房租情况。
通过常用的三部曲:数据获取、数据清洗预览、数据分析可视化,与你一起探究最近房租的状况。
一、数据获取
今天就把目前市场占有率最高的房屋中介公司为目标,来获取北京、上海两大城市的租房信息。

整体思路是:
- 先爬取每个区域的url和名称,跟主url拼接成一个完整的url,循环url列表,依次爬取每个区域的租房信息。
- 在爬每个区域的租房信息时,找到最大的页码,遍历页码,依次爬取每一页的二手房信息。
post代码之前简单讲一下这里用到的几个爬虫Python包:
- requests: 就是用来请求对链家网进行访问的包
- lxml: 解析网页,用xpath表达式与正则表达式一起来获取网页信息,相比bs4速度更快
详细代码如下:
- <font size="3"><font color="rgb(248, 35, 117)">import</font> requests
- <font color="rgb(248, 35, 117)">import</font> time
- <font color="rgb(248, 35, 117)">import</font> re
- <font color="rgb(248, 35, 117)">from</font> lxml <font color="rgb(248, 35, 117)">import</font> etree
- <font color="rgb(128, 128, 128)"># 获取某市区域的所有链接</font>
- <font color="rgb(248, 35, 117)">def get_areas(url):</font>
- print(<font color="rgb(238, 220, 112)">'start grabing areas'</font>)
- headers = {
- <font color="rgb(238, 220, 112)">'User-Agent'</font>: <font color="rgb(238, 220, 112)">'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36'</font>}
- resposne = requests.get(url, headers=headers)
- content = etree.HTML(resposne.text)
- areas = content.xpath(<font color="rgb(238, 220, 112)">"//dd[@data-index = '0']//div[@class='option-list']/a/text()"</font>)
- areas_link = content.xpath(<font color="rgb(238, 220, 112)">"//dd[@data-index = '0']//div[@class='option-list']/a/@href"</font>)
- <font color="rgb(248, 35, 117)">for</font> i <font color="rgb(248, 35, 117)">in</font> range(<font color="rgb(174, 135, 250)">1</font>,len(areas)):
- area = areas</font><font size="3">
- area_link = areas_link</font><font size="3">
- link = <font color="rgb(238, 220, 112)">'https://bj.lianjia.com'</font> + area_link
- print(<font color="rgb(238, 220, 112)">"开始抓取页面"</font>)
- get_pages(area, link)
- <font color="rgb(128, 128, 128)">#通过获取某一区域的页数,来拼接某一页的链接</font>
- <font color="rgb(248, 35, 117)">def get_pages(area,area_link):</font>
- headers = {
- <font color="rgb(238, 220, 112)">'User-Agent'</font>: <font color="rgb(238, 220, 112)">'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36'</font>}
- resposne = requests.get(area_link, headers=headers)
- pages = int(re.findall(<font color="rgb(238, 220, 112)">"page-data=\'{"totalPage":(\d+),"curPage""</font>, resposne.text)[<font color="rgb(174, 135, 250)">0</font>])
- print(<font color="rgb(238, 220, 112)">"这个区域有"</font> + str(pages) + <font color="rgb(238, 220, 112)">"页"</font>)
- <font color="rgb(248, 35, 117)">for</font> page <font color="rgb(248, 35, 117)">in</font> range(<font color="rgb(174, 135, 250)">1</font>,pages+<font color="rgb(174, 135, 250)">1</font>):
- url = <font color="rgb(238, 220, 112)">'https://bj.lianjia.com/zufang/dongcheng/pg'</font> + str(page)
- print(<font color="rgb(238, 220, 112)">"开始抓取"</font> + str(page) +<font color="rgb(238, 220, 112)">"的信息"</font>)
- get_house_info(area,url)
- <font color="rgb(128, 128, 128)">#获取某一区域某一页的详细房租信息</font>
- <font color="rgb(248, 35, 117)">def get_house_info(area, url):</font>
- headers = {
- <font color="rgb(238, 220, 112)">'User-Agent'</font>: <font color="rgb(238, 220, 112)">'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36'</font>}
- time.sleep(<font color="rgb(174, 135, 250)">2</font>)
- <font color="rgb(248, 35, 117)">try</font>:
- resposne = requests.get(url, headers=headers)
- content = etree.HTML(resposne.text)
- info=[]
- <font color="rgb(248, 35, 117)">for</font> i <font color="rgb(248, 35, 117)">in</font> range(<font color="rgb(174, 135, 250)">30</font>):
- title = content.xpath(<font color="rgb(238, 220, 112)">"//div[@class='where']/a/span/text()"</font>)</font><font size="3">
- room_type = content.xpath(<font color="rgb(238, 220, 112)">"//div[@class='where']/span[1]/span/text()"</font>)</font><font size="3">
- square = re.findall(<font color="rgb(238, 220, 112)">"(\d+)"</font>,content.xpath(<font color="rgb(238, 220, 112)">"//div[@class='where']/span[2]/text()"</font>)</font><font size="3">)[<font color="rgb(174, 135, 250)">0</font>]
- position = content.xpath(<font color="rgb(238, 220, 112)">"//div[@class='where']/span[3]/text()"</font>)</font><font size="3">.replace(<font color="rgb(238, 220, 112)">" "</font>, <font color="rgb(238, 220, 112)">""</font>)
- <font color="rgb(248, 35, 117)">try</font>:
- detail_place = re.findall(<font color="rgb(238, 220, 112)">"([\u4E00-\u9FA5]+)租房"</font>, content.xpath(<font color="rgb(238, 220, 112)">"//div[@class='other']/div/a/text()"</font>)</font><font size="3">)[<font color="rgb(174, 135, 250)">0</font>]
- <font color="rgb(248, 35, 117)">except</font> Exception <font color="rgb(248, 35, 117)">as</font> e:
- detail_place = <font color="rgb(238, 220, 112)">""</font>
- floor =re.findall(<font color="rgb(238, 220, 112)">"([\u4E00-\u9FA5]+)\("</font>, content.xpath(<font color="rgb(238, 220, 112)">"//div[@class='other']/div/text()[1]"</font>)</font><font size="3">)[<font color="rgb(174, 135, 250)">0</font>]
- total_floor = re.findall(<font color="rgb(238, 220, 112)">"(\d+)"</font>,content.xpath(<font color="rgb(238, 220, 112)">"//div[@class='other']/div/text()[1]"</font>)</font><font size="3">)[<font color="rgb(174, 135, 250)">0</font>]
- <font color="rgb(248, 35, 117)">try</font>:
- house_year = re.findall(<font color="rgb(238, 220, 112)">"(\d+)"</font>,content.xpath(<font color="rgb(238, 220, 112)">"//div[@class='other']/div/text()[2]"</font>)</font><font size="3">)[<font color="rgb(174, 135, 250)">0</font>]
- <font color="rgb(248, 35, 117)">except</font> Exception <font color="rgb(248, 35, 117)">as</font> e:
- house_year = <font color="rgb(238, 220, 112)">""</font>
- price = content.xpath(<font color="rgb(238, 220, 112)">"//div[@class='col-3']/div/span/text()"</font>)</font><font size="3">
- <font color="rgb(248, 35, 117)">with</font> open(<font color="rgb(238, 220, 112)">'链家北京租房.txt'</font>,<font color="rgb(238, 220, 112)">'a'</font>,encoding=<font color="rgb(238, 220, 112)">'utf-8'</font>) <font color="rgb(248, 35, 117)">as</font> f:
- f.write(area + <font color="rgb(238, 220, 112)">','</font> + title + <font color="rgb(238, 220, 112)">','</font> + room_type + <font color="rgb(238, 220, 112)">','</font> + square + <font color="rgb(238, 220, 112)">','</font> +position+
- <font color="rgb(238, 220, 112)">','</font>+ detail_place+<font color="rgb(238, 220, 112)">','</font>+floor+<font color="rgb(238, 220, 112)">','</font>+total_floor+<font color="rgb(238, 220, 112)">','</font>+price+<font color="rgb(238, 220, 112)">','</font>+house_year+<font color="rgb(238, 220, 112)">'\n'</font>)
- print(<font color="rgb(238, 220, 112)">'writing work has done!continue the next page'</font>)
- <font color="rgb(248, 35, 117)">except</font> Exception <font color="rgb(248, 35, 117)">as</font> e:
- print( <font color="rgb(238, 220, 112)">'ooops! connecting error, retrying.....'</font>)
- time.sleep(<font color="rgb(174, 135, 250)">20</font>)
- <font color="rgb(248, 35, 117)">return</font> get_house_info(area, url)
- <font color="rgb(248, 35, 117)">def main():</font>
- print(<font color="rgb(238, 220, 112)">'start!'</font>)
- url = <font color="rgb(238, 220, 112)">'https://bj.lianjia.com/zufang'</font>
- get_areas(url)
- <font color="rgb(248, 35, 117)">if</font> __name__ == <font color="rgb(238, 220, 112)">'__main__'</font>:
- main()</font>
二、数据清洗预览

数据共14038条,10个维度,由上图可看出北京房源均价为9590元/月,中位数为7000。一半的房源价格在7000以下,所有房源的价格区间为[1000,250000],价格极差过大。
三、数据分析可视化
四维度-北京房租均价
接下来,将北京各区域、各路段、各楼盘房屋数量、均价分布放在同一张图上,更直观地来看待房租。

从图中可看出,最近,北京市各区域的房租均在6000元/月以上,其中最高区域为东城,均价达12463元/月。不过,由于房源信息过多过杂,房屋位置、面积、楼层、朝向等对价格均有较大影响,因此,价格这个维度需要进一步分析。

由上图可得,各路段的均价基本都在6000以上,其中海淀北部新区的房源数最多,但均价最低,为3308元/月,这或许与海淀北部生态科技新区作为高新技术产业的承载区、原始创新策源地的研发基地,以及科技园集聚区,目前已入驻华为、联想、百度、腾讯、IBM、Oracle等近2000家国内外知名的科技创新型企业有关。另一方面,海淀紫竹桥的房价竟一起冲天,其附近以博物馆、体育场馆为特色,交通便利,配套设施完善,均价较高也是情理之中。

可以看出,不同楼盘的均价浮动很大,但都在6000/月以上。最高的甚至达到17516/月。由于每个楼盘户型差别较大,地理位置也较为分散,因此均价波动很大。每个楼盘具体情况还需具体分析。
附详情代码:
- <font color="rgb(128, 128, 128)">#北京路段_房屋均价分布图</font>
- detail_place = df.groupby([<font color="rgb(238, 220, 112)">'detail_place'</font>])
- house_com = detail_place[<font color="rgb(238, 220, 112)">'price'</font>].agg([<font color="rgb(238, 220, 112)">'mean'</font>,<font color="rgb(238, 220, 112)">'count'</font>])
- house_com.reset_index(inplace=<font color="rgb(248, 35, 117)">True</font>)
- detail_place_main = house_com.sort_values(<font color="rgb(238, 220, 112)">'count'</font>,ascending=<font color="rgb(248, 35, 117)">False</font>)[<font color="rgb(174, 135, 250)">0</font>:<font color="rgb(174, 135, 250)">20</font>]
- attr = detail_place_main[<font color="rgb(238, 220, 112)">'detail_place'</font>]
- v1 = detail_place_main[<font color="rgb(238, 220, 112)">'count'</font>]
- v2 = detail_place_main[<font color="rgb(238, 220, 112)">'mean'</font>]
- line = Line(<font color="rgb(238, 220, 112)">"北京主要路段房租均价"</font>)
- line.add(<font color="rgb(238, 220, 112)">"路段"</font>,attr,v2,is_stack=<font color="rgb(248, 35, 117)">True</font>,xaxis_rotate=<font color="rgb(174, 135, 250)">30</font>,yaxix_min=<font color="rgb(174, 135, 250)">4.2</font>,
- mark_point=[<font color="rgb(238, 220, 112)">'min'</font>,<font color="rgb(238, 220, 112)">'max'</font>],xaxis_interval=<font color="rgb(174, 135, 250)">0</font>,line_color=<font color="rgb(238, 220, 112)">'lightblue'</font>,
- line_width=<font color="rgb(174, 135, 250)">4</font>,mark_point_textcolor=<font color="rgb(238, 220, 112)">'black'</font>,mark_point_color=<font color="rgb(238, 220, 112)">'lightblue'</font>,
- is_splitline_show=<font color="rgb(248, 35, 117)">False</font>)
- bar = Bar(<font color="rgb(238, 220, 112)">"北京主要路段房屋数量"</font>)
- bar.add(<font color="rgb(238, 220, 112)">"路段"</font>,attr,v1,is_stack=<font color="rgb(248, 35, 117)">True</font>,xaxis_rotate=<font color="rgb(174, 135, 250)">30</font>,yaxix_min=<font color="rgb(174, 135, 250)">4.2</font>,
- xaxis_interval=<font color="rgb(174, 135, 250)">0</font>,is_splitline_show=<font color="rgb(248, 35, 117)">False</font>)
- overlap = Overlap()
- overlap.add(bar)
- overlap.add(line,yaxis_index=<font color="rgb(174, 135, 250)">1</font>,is_add_yaxis=<font color="rgb(248, 35, 117)">True</font>)
- overlap.render(<font color="rgb(238, 220, 112)">'北京路段_房屋均价分布图.html'</font>)

由上图可以看出,均价在 8000-10000 之间的房屋数量最多,同时 1500-2000 这个价位之间房屋数少的可怜。
据北京市统计局的数据,2017 年全市居民月人均可支配收入为 4769 元。另据 58 同城和赶集网发布的报告,2017 年北京人均月租金为 2795 元。
北京租房者的房租收入比,惊人地接近 60%。很多人一半的收入,都花在了租房上,人生就这样被锁定在贫困线上。
统计数据也表明,北京租房人群收入整体偏低。47% 的租房人,年薪在 10 万以下。
在北京,能够负担得起每月 5000 元左右房租的群体,就算得上是中高收入人群。
就这样,第一批 90 后扛过了离婚、秃头、出家和生育,终于还是倒在了房租面前。
附详情代码:
- <font size="3" style="font-style: normal;"><font color="rgb(128, 128, 128)">#房源价格区间分布图</font>
- price_info = df[[<font color="rgb(238, 220, 112)">'area'</font>, <font color="rgb(238, 220, 112)">'price'</font>]]
- <font color="rgb(128, 128, 128)">#对价格分区</font>
- bins = [<font color="rgb(174, 135, 250)">0</font>,<font color="rgb(174, 135, 250)">1000</font>,<font color="rgb(174, 135, 250)">1500</font>,<font color="rgb(174, 135, 250)">2000</font>,<font color="rgb(174, 135, 250)">2500</font>,<font color="rgb(174, 135, 250)">3000</font>,<font color="rgb(174, 135, 250)">4000</font>,<font color="rgb(174, 135, 250)">5000</font>,<font color="rgb(174, 135, 250)">6000</font>,<font color="rgb(174, 135, 250)">8000</font>,<font color="rgb(174, 135, 250)">10000</font>]
- level = [<font color="rgb(238, 220, 112)">'0-1000'</font>,<font color="rgb(238, 220, 112)">'1000-1500'</font>, <font color="rgb(238, 220, 112)">'1500-2000'</font>, <font color="rgb(238, 220, 112)">'2000-3000'</font>, <font color="rgb(238, 220, 112)">'3000-4000'</font>, <font color="rgb(238, 220, 112)">'4000-5000'</font>, <font color="rgb(238, 220, 112)">'5000-6000'</font>, <font color="rgb(238, 220, 112)">'6000-8000'</font>, <font color="rgb(238, 220, 112)">'8000-1000'</font>,<font color="rgb(238, 220, 112)">'10000以上'</font>]
- price_stage = pd.cut(price_info[<font color="rgb(238, 220, 112)">'price'</font>], bins = bins,labels = level).value_counts().sort_index()
- attr = price_stage.index
- v1 = price_stage.values
- bar = Bar(<font color="rgb(238, 220, 112)">"价格区间&房源数量分布"</font>)
- bar.add(<font color="rgb(238, 220, 112)">""</font>,attr,v1,is_stack=<font color="rgb(248, 35, 117)">True</font>,xaxis_rotate=<font color="rgb(174, 135, 250)">30</font>,yaxix_min=<font color="rgb(174, 135, 250)">4.2</font>,
- xaxis_interval=<font color="rgb(174, 135, 250)">0</font>,is_splitline_show=<font color="rgb(248, 35, 117)">False</font>)
- overlap = Overlap()
- overlap.add(bar)
- overlap.render(<font color="rgb(238, 220, 112)">'价格区间&房源数量分布.html'</font>)</font><div align="left"></div>
面积&租金分布呈阶梯性

上图可以看出,80%的房源面积集中在0-90平方米之间,也符合租客单租与合租情况,大面积的房屋很少。

面积&租金分布呈阶梯性,比较符合常理。租房主力军就是上班族了,一般对房子面积要求较低,基本集中在30平。
附详情代码:
- <font color="rgb(128, 128, 128)">#房屋面积分布</font>
- bins =[<font color="rgb(174, 135, 250)">0</font>,<font color="rgb(174, 135, 250)">30</font>,<font color="rgb(174, 135, 250)">60</font>,<font color="rgb(174, 135, 250)">90</font>,<font color="rgb(174, 135, 250)">120</font>,<font color="rgb(174, 135, 250)">150</font>,<font color="rgb(174, 135, 250)">200</font>,<font color="rgb(174, 135, 250)">300</font>,<font color="rgb(174, 135, 250)">400</font>,<font color="rgb(174, 135, 250)">700</font>]
- level = [<font color="rgb(238, 220, 112)">'0-30'</font>, <font color="rgb(238, 220, 112)">'30-60'</font>, <font color="rgb(238, 220, 112)">'60-90'</font>, <font color="rgb(238, 220, 112)">'90-120'</font>, <font color="rgb(238, 220, 112)">'120-150'</font>, <font color="rgb(238, 220, 112)">'150-200'</font>, <font color="rgb(238, 220, 112)">'200-300'</font>,<font color="rgb(238, 220, 112)">'300-400'</font>,<font color="rgb(238, 220, 112)">'400+'</font>]
- df[<font color="rgb(238, 220, 112)">'square_level'</font>] = pd.cut(df[<font color="rgb(238, 220, 112)">'square'</font>],bins = bins,labels = level)
- df_digit= df[[<font color="rgb(238, 220, 112)">'area'</font>, <font color="rgb(238, 220, 112)">'room_type'</font>, <font color="rgb(238, 220, 112)">'square'</font>, <font color="rgb(238, 220, 112)">'position'</font>, <font color="rgb(238, 220, 112)">'total_floor'</font>, <font color="rgb(238, 220, 112)">'floor'</font>, <font color="rgb(238, 220, 112)">'house_year'</font>, <font color="rgb(238, 220, 112)">'price'</font>, <font color="rgb(238, 220, 112)">'square_level'</font>]]
- s = df_digit[<font color="rgb(238, 220, 112)">'square_level'</font>].value_counts()
- attr = s.index
- v1 = s.values
- pie = Pie(<font color="rgb(238, 220, 112)">"房屋面积分布"</font>,title_pos=<font color="rgb(238, 220, 112)">'center'</font>)
- pie.add(
- <font color="rgb(238, 220, 112)">""</font>,
- attr,
- v1,
- radius=[<font color="rgb(174, 135, 250)">40</font>, <font color="rgb(174, 135, 250)">75</font>],
- label_text_color=<font color="rgb(248, 35, 117)">None</font>,
- is_label_show=<font color="rgb(248, 35, 117)">True</font>,
- legend_orient=<font color="rgb(238, 220, 112)">"vertical"</font>,
- legend_pos=<font color="rgb(238, 220, 112)">"left"</font>,
- )
- overlap = Overlap()
- overlap.add(pie)
- overlap.render(<font color="rgb(238, 220, 112)">'房屋面积分布.html'</font>)
- <font color="rgb(128, 128, 128)">#房屋面积&价位分布</font>
- bins =[<font color="rgb(174, 135, 250)">0</font>,<font color="rgb(174, 135, 250)">30</font>,<font color="rgb(174, 135, 250)">60</font>,<font color="rgb(174, 135, 250)">90</font>,<font color="rgb(174, 135, 250)">120</font>,<font color="rgb(174, 135, 250)">150</font>,<font color="rgb(174, 135, 250)">200</font>,<font color="rgb(174, 135, 250)">300</font>,<font color="rgb(174, 135, 250)">400</font>,<font color="rgb(174, 135, 250)">700</font>]
- level = [<font color="rgb(238, 220, 112)">'0-30'</font>, <font color="rgb(238, 220, 112)">'30-60'</font>, <font color="rgb(238, 220, 112)">'60-90'</font>, <font color="rgb(238, 220, 112)">'90-120'</font>, <font color="rgb(238, 220, 112)">'120-150'</font>, <font color="rgb(238, 220, 112)">'150-200'</font>, <font color="rgb(238, 220, 112)">'200-300'</font>,<font color="rgb(238, 220, 112)">'300-400'</font>,<font color="rgb(238, 220, 112)">'400+'</font>]
- df[<font color="rgb(238, 220, 112)">'square_level'</font>] = pd.cut(df[<font color="rgb(238, 220, 112)">'square'</font>],bins = bins,labels = level)
- df_digit= df[[<font color="rgb(238, 220, 112)">'area'</font>, <font color="rgb(238, 220, 112)">'room_type'</font>, <font color="rgb(238, 220, 112)">'square'</font>, <font color="rgb(238, 220, 112)">'position'</font>, <font color="rgb(238, 220, 112)">'total_floor'</font>, <font color="rgb(238, 220, 112)">'floor'</font>, <font color="rgb(238, 220, 112)">'house_year'</font>, <font color="rgb(238, 220, 112)">'price'</font>, <font color="rgb(238, 220, 112)">'square_level'</font>]]
- square = df_digit[[<font color="rgb(238, 220, 112)">'square_level'</font>,<font color="rgb(238, 220, 112)">'price'</font>]]
- prices = square.groupby(<font color="rgb(238, 220, 112)">'square_level'</font>).mean().reset_index()
- amount = square.groupby(<font color="rgb(238, 220, 112)">'square_level'</font>).count().reset_index()
- attr = prices[<font color="rgb(238, 220, 112)">'square_level'</font>]
- v1 = prices[<font color="rgb(238, 220, 112)">'price'</font>]
- pie = Bar(<font color="rgb(238, 220, 112)">"房屋面积&价位分布布"</font>)
- pie.add(<font color="rgb(238, 220, 112)">""</font>, attr, v1, is_label_show=<font color="rgb(248, 35, 117)">True</font>)
- pie.render()
- bar = Bar(<font color="rgb(238, 220, 112)">"房屋面积&价位分布"</font>)
- bar.add(<font color="rgb(238, 220, 112)">""</font>,attr,v1,is_stack=<font color="rgb(248, 35, 117)">True</font>,xaxis_rotate=<font color="rgb(174, 135, 250)">30</font>,yaxix_min=<font color="rgb(174, 135, 250)">4.2</font>,
- xaxis_interval=<font color="rgb(174, 135, 250)">0</font>,is_splitline_show=<font color="rgb(248, 35, 117)">False</font>)
- overlap = Overlap()
- overlap.add(bar)
- overlap.render(<font color="rgb(238, 220, 112)">'房屋面积&价位分布.html'</font>)
大多数房屋年龄在10年以上

由上图看出,房屋年龄大多集中在10-20年、25年以上,而5年以下的不到2%;不过,别看这些都是老房子,最近房租变得这么猖狂?原因其中之一就是资本圈地。

这条网贴立马点燃了大众的情绪:“好啊,原来是这些长租平台烧钱圈地,一心只想要垄断市场房源,哄抬租金,企图赚取暴利差价!”
四、后记
拿自如举例,表面上看跟中介公司没啥两样,收了各种散盘,然后集中装修、出租、管理,因为运营成本和住房质量提高,房租肯定有所上涨。
但更关键的事情在背后。自如把项目打包起来搞起了资产证券化,以租金收益权为基础资产做担保,投放到金融市场上发行国内首单租房市场消费分期类ABS,让各路资金来认购,每年给大家搞点分红。
大量资本都在赌租房这个风口,而前期谁的规模越大、资源越多,以后的定价权就越大,利润空间就越不可想象。
这次一共从链家网上爬取 14038 条数据,而那就是大概一周前,8 月 17 日北京住建委约谈了几家中介公司。
最终的结果是自如、相寓和蛋壳承诺将拿出 12 万间房子投入市场其中,自如将拿出 8 万间(链家、自如、贝壳找房,他们的实际控制人是同一个人--链家老板左晖)。

也就是说,平常的时候,链家网+自如一共在网上待租的也就是 1 万多套房子,但是一被约谈他们就一口气拿出了 8 万套房子增援??怎么增?继续收房,让房源更加供不应求?
昨天买不起房,今天租不起房,如果连这样的生活也要因为市场的不规范而被逼迫、被夺走,真的会让人对一个城市失去希望。