movies

SQL-DataCamp-Data-Driven Decision Making in SQL

时间秒杀一切 提交于 2020-01-24 02:05:35
1. Introduction to Business Intelligence for a Online Movie Rental Database 1.1Introduction to data driven decision making 1.2 Exploring the database 1.3 Exploring the table renting 1.4 Filtering and ordering 1.5 Working with dates 1.7 Selecting movies 1.8 Select from renting 1.9 Aggregations - summarizing data 1.10 Summarizing customer information 1.11 Ratings of movie 25 1.12 Examining annual rentals 2. Decision Making with Simple SQL Queries 2.1 Grouping movies 2.2 First account for each country 2.3 Average movie ratings 2.4 Joining movie ratings with customer data 2.5 Join renting and

推荐系统-05-Spark电影推荐、评估与部署

一笑奈何 提交于 2020-01-18 12:07:33
一、新建scala项目 二、构造程序 代码如下 package xyz.pl8 import java.io.File import org.apache.log4j.{Level, Logger} import org.apache.spark.{SparkContext, SparkConf} import org.apache.spark.mllib.evaluation.RegressionMetrics import org.apache.spark.mllib.recommendation.{MatrixFactorizationModel, Rating, ALS} import org.apache.spark.rdd.RDD import scala.util.Random object MovieLensALS { //1. Define a rating elicitation function // Seq[Rating] def elicitateRating(movies: Seq[(Int, String)])={ val prompt="Please rate the following movie(1-5(best) or 0 if not seen: )" println(prompt) val ratings= movies.flatMap{x

Hive实战之影音系统练习

让人想犯罪 __ 提交于 2020-01-11 12:46:00
package com.dt.spark.cores.java.HiveDataMode; import org.apache.spark.SparkConf; import org.apache.spark.api.java.JavaRDD; import org.apache.spark.api.java.JavaSparkContext; import org.apache.spark.api.java.function.Function; import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Row; import org.apache.spark.sql.SQLContext; import org.apache.spark.sql.SaveMode; //Hive实战之影音系统,所涉及数据为etc\\Video\\目录下的数据 //数据治理Java实现 public class HiveDataModeSpark { public static void main(String[] args){ SparkConf conf = new SparkConf().setMaster("local[2]").setAppName("HiveDataModeSpark");

字典&列表的拓展理解

a 夏天 提交于 2020-01-03 04:11:57
列表&字典的拓展应用 1、使用普通的逻辑语句 menu = ''' 请输入您的操作: 1. 查询所有电影,请按1; 2. 添加一个电影,请按2; 3. 根据指定序号删除一个电影,请按3; 4. 根据电影名删除一个电影,请按4; 5. 退出系统,请按其它键。 ''' movies = [ {"name": "蚁人1:黄蜂女现身", "category": "科幻", "date": "2018"}, {"name": "蚁人2:黄蜂女现身", "category": "科幻", "date": "2018"}, {"name": "蚁人3:黄蜂女现身", "category": "科幻", "date": "2018"} ] while True: c=input(menu) if c=="1": print("序号\t\t\t电影名称\t\t\t类别\t\t\t年代") for i,movie in enumerate(movies): # print("{0}\t\t\t{1}\t\t\t{2}\t\t\t{3}".format(i + 1, movie['name'], movie['category'], movie['date'])) print("{0}\t{1}\t\t{2}\t\t\t{3}".format(i+1,movie['name'],movie[

[LeetCode] Not Boring Movies

﹥>﹥吖頭↗ 提交于 2019-12-27 17:52:47
X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a poster indicating the movies’ ratings and descriptions. Please write a SQL query to output movies with an odd numbered ID and a description that is not 'boring'. Order the result by rating. For example, table cinema : +---------+-----------+--------------+-----------+ | id | movie | description | rating | +---------+-----------+--------------+-----------+ | 1 | War | great 3D | 8.9 | | 2 | Science | fiction | 8.5 | | 3 | irish | boring | 6.2 | | 4 | Ice song | Fantacy | 8.6 | | 5 | House card|

mongodb shell脚本 增删改查

时间秒杀一切 提交于 2019-12-25 03:51:46
MongoDB第二节课作业 配置环境变量后,命令行输入:mongo //1.进入my_test数据库 show dbs; use my_test; show collections; //2.向数据库的user集合中插入一个usename为deer的文档 //3.查询user集合中的文档 //4.向数据库的user集合中插入一个usename为james的文档 //5.查询数据库user集合中的文档 //6.统计数据库user集合中的文档数量 db.user.find({}).size(); //7.查询数据库user集合中username为deer的文档 //8.向数据库user集合中的username为deer的文档,添加一个address属性,属性值为changsha db.user.updateMany({"username":"deer"},{$set:{"address":"changsha"}}); //9.使用{username:"peter"} 替换 username 为 james的文档 db.user.updateMany({"username":"peter"},{$set:{"username":"james"}}); // 根据ID更新 db.user.updateMany({"_id":ObjectId(

SettingWithCopyWarning and Copy in Python

大城市里の小女人 提交于 2019-12-20 11:39:47
Introduction SettingWithCopyWarning is a common warning in Python. Most of us tend to ignore all kinds of warning inculding this one, and only focus on our main task. This SettingWithCopyWarning is so special because it will have two situations. In one situation python won't apply what we ordered. While in the other situation it will. Another thing we care about is copy in Python. We already know there are two kinds of copy in Python: shallow copy and deep copy. Some people will also say, view and copy. Actually the reason why Python shows SettingWithCopyWarning is related to copy behavior. In

ASP.NET MVC 5 -从控制器访问数据模型

只谈情不闲聊 提交于 2019-12-17 02:02:24
在本节中,您将创建一个新的 MoviesController 类,并在这个Controller类里编写代码来取得电影数据,并使用视图模板将数据展示在浏览器里。 在开始下一步前,先Build一下应用程序( 生成应用程序) (确保应用程序编译没有问题) 在 解决方案 上,用鼠标右键单击Controller文件夹,点击 新增 ,再选择 Controller 。 在 Scaffold 新增 对话框,选择 MVC 5 Controller with views, using Entity Framework , 点击 新增。 · 控制器(Controller)名称输入: MoviesController . · 模型类(Model class)选择: Movie (MvcMovie.Models) . · 数据上下文类(Data context class)选择: MovieDBContext (MvcMovie.Models) 下图显示了完成的对话框。 单击 添加( 如果你得到一个错误,则很可能 增加控制器前 ,没有生成该应用程序)。Visual Studio Express 会创建以下文件和文件夹: · 项目控制器文件夹中的 MoviesController.cs 文件。 · 项目视图文件夹下的 Movie文件夹。 · 在新的Views\Movies 文件夹中创建Create

How to include movie showtimes in Google Movies?

断了今生、忘了曾经 提交于 2019-12-11 13:18:53
问题 I am making the website of a movie theater, and I want Google Movies to index the showtimes I publish on the website. Does anyone know if there's a way to do this? Maybe using Microformats? Or exposing this information using RSS or something similar? 回答1: I don't believe that Google harvest the show times from the theater web site, they probably buy/tap into a reliable source for that. At most you need to make sure that the theater is listed under Google Local. 来源: https://stackoverflow.com

豆瓣Top250

你离开我真会死。 提交于 2019-12-11 10:32:06
1 """ 2 爬取豆瓣电影TOP250 - 完整示例代码 3 """ 4 5 import codecs 6 7 import requests 8 from bs4 import BeautifulSoup 9 10 DOWNLOAD_URL = 'http://movie.douban.com/top250/' 11 12 13 def download_page(url): 14 return requests.get(url, headers={ 15 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36' 16 }).content 17 18 19 def parse_html(html): 20 soup = BeautifulSoup(html) 21 movie_list_soup = soup.find('ol', attrs={'class': 'grid_view'}) 22 23 movie_name_list = [] 24 25 for movie_li in movie_list_soup.find_all('li'): 26