Author: Xiaoyu Xing
Data set: TMDb movie data
Question to investigate:
Summary of conclusion:
First, I loaded the csv file as dataframe, then first have look at of it.
import numpy as np
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import matplotlib.pyplot as plt # this is used for the plot the graph
import seaborn as sns # used for plot interactive graph.
%matplotlib inline
raw_data = pd.read_csv('tmdb-movies.csv')
# Get familiar with columns
raw_data.columns
# Get familiar with the table
raw_data.head()
# Dig into the data further to find out "dirty"/unexpeted data
raw_data.describe()
After going throught the above data briefly, I noticed there the minimum value in runtime, budget, budget_adj, revenue, and revenue_adj were 0, which was quite unreasonable. Even though it's said this data was after cleaning, but I believed these entries with unusual 0 numbers should be removed before further exploration due to the low reliability.
# Replace 0 with NaN and drop them in all entries.
abs_non0_data = raw_data.replace(0, np.nan, inplace = False)
abs_non0_data.dropna(inplace = True)
# Check the data again
abs_non0_data.describe()
However, after this processing, the size of sample was reduce a lot. So I decided to create another data set that only removed the entries with the 0 runtime, but keep the entries with 0 budget and revenue.
# Replace 0 with NaN and drop them ONLY in column 'runtime'.
clean_data = raw_data.replace(0, np.nan, inplace = False)
clean_data.dropna(subset = ['runtime'],inplace = True)
# Check the data again
clean_data.describe()
I will use the abs_non0_data for correlation analysis between popularity with budget and revenue, and use the clean_data for other analysis.
# Get a brief idea of how the popularity (this is what I am interested in) correlated with other factors.
plt.figure(figsize = (10,8))
correlation_map = sns.heatmap(clean_data.corr(),annot=True, fmt = ".2f", cmap = "coolwarm",linewidths= 0.01).set_title(
'Correlation (in Pearson r value) of Properties of Movies from 1960 to 2015')
From the above correlation map, we can see the popularity has a high correlation with vote_count, vote, budget_adj, and revenue_adj. Next, I will explore the correlation of each independent variables with the popularity.
# Use jointplot to show correlation of popularity and vote_count
plt.figure(figsize = (10,10))
sns.set(style="white", color_codes=True)
pop_vote_count_map = sns.jointplot(x="vote_count", y="popularity", data=clean_data, kind="reg")
pop_vote_count_map.fig.suptitle('Correlation of Popularity and vote_count of Movies from 1960 to 2015')
Conclusion: Most movies have less than 4000 votes and less than 5 of popularity. But for movies with higher popularity, the votes_count usually higher. And the the pearson r value showed a strong correlation between these two. But we CANNOT conclude the cause and effect reasoning. But it's possible that if a movie is really good, people would like to vote at IMDB, so the popularity will increase.
# Use jointplot to show correlation of popularity and vote_average
pop_vote_map = sns.jointplot(x="vote_average", y="popularity", data=clean_data, kind="reg", color='green')
pop_vote_map.fig.suptitle('Correlation of Popularity and vote_average of Movies from 1960 to 2015')
Conclusion: We can see movies with higher vote_average score usually have a higher popularity, especially in the range of 6 to 8 in vote_average. For movies in 8 to 10 in vote_average, it seems like these movies can only enjoyed in a small group of people. Though their high votes, the popularity is still low.
This graph was made from the abs_non0_data, where the 0 entries in budget_adj and revenue_adj were removed for a better reliability.
# Use jointplot to show correlation of popularity and budget_adj
pop_budget_map = sns.jointplot(x="budget_adj", y="popularity", data=abs_non0_data, kind="reg", color='red')
pop_budget_map.fig.suptitle('Correlation of Popularity and Budget of Movies from 1960 to 2015')
Conclusion: Most movies shows a budgets below 0.2 billion dollars, and below 5 popularity. But there are some exceptions, which have a high popularity but not a high budget; also there are some exceptions, wich have a high budget but not a high popularity. Even though the pearson r value gives 0.42, the correlation mainly reside within 0.2 billion, where higher budget shows a higher popularity.
This graph was made from the abs_non0_data, where the 0 entries in budget_adj and revenue_adj were removed for a better reliability.
# Use jointplot to show correlation of popularity and revenue_adj
pop_revenue_map = sns.jointplot(x="revenue_adj", y="popularity", data=abs_non0_data, kind="reg", color='purple')
pop_revenue_map.fig.suptitle('Correlation of Popularity and Revenue of Movies from 1960 to 2015')
Conclusion: We can see a correlation with revenue and popularity. Movies with higher revenue usually have a higher popularity.
Below analysis was based on the abs_non0_data, where the 0 entries in budget_adj and revenue_adj were removed for a meaningful discussion.
# Calculate profit, and insert as a new column
abs_non0_data['profit'] = abs_non0_data['revenue_adj'] - abs_non0_data['budget_adj'] # profit = revenue - budget
abs_non0_data['profit_boolean'] = abs_non0_data['profit'] > 0 # whether a movie is profitable, store boolean in a new column
# Check new columns
abs_non0_data.head()
# Group by release_year, calculate the mean for each year.
profit_mean_by_year = abs_non0_data.groupby('release_year', as_index=False)['profit'].mean()
# Find out how profit correlates with release year.
plt.figure(figsize = (6,12))
yearly_profit = sns.barplot(x='profit',y='release_year', data=profit_mean_by_year, orient='h').set_title(
'Mean of Profit (in USD) with Release Year of Movies from 1960 to 2015')
Conclusion: Movies made more profits in the 60s and 70s of last centry, less profit was made these years.
# Split the genres into list, store in new column
abs_non0_data['genres_list'] = abs_non0_data['genres'].str.split('|') # split by '|'
abs_non0_data.head() # Check new column
# Create a set to store the unique genre keywords.
genre_type = set()
for each_element in abs_non0_data['genres_list']:
for each_word in each_element:
genre_type.add(each_word)
genre_type
# Determine whether a movie contains a certain genre, stored boolean in individual column
for each_genre in genre_type:
abs_non0_data[each_genre] = abs_non0_data['genres_list'].apply(lambda x:each_genre in x)
# if a certain genre in the genre_list, store the boolean in a new column (with the genre as the column name)
abs_non0_data.head() # Check new columns
# get the mean budget/revenue/profit for each genre.
# If a movie contains multiple genres, it will be counted and calculated in multiple catagories.
mean_by_genre_df = pd.DataFrame() # new dataframe
for each_genre in genre_type:
this_genre_only_df = abs_non0_data[abs_non0_data[each_genre]==True] # Temporary dataframe with only this genre
new_series = this_genre_only_df[['budget_adj', 'revenue_adj', 'profit']].mean()
# Calculate the means of budget, revenue, and profit for this genre, stored in a series.
mean_by_genre_df[each_genre] = new_series # Add this new series into the new dataframe.
mean_by_genre_df # Check this new dataframe
# For a better visulization in below graph, above dataframe was transposed and added a new genre column.
mean_by_genre_transpose_df = mean_by_genre_df.transpose()
mean_by_genre_transpose_df['genre'] = mean_by_genre_transpose_df.index
mean_by_genre_transpose_df # Check the new transposed dataframe
# Processing the data further for a better bar graph.
melted_mean_by_genre = pd.melt(mean_by_genre_transpose_df, id_vars='genre', var_name='item', value_name='dollars')
melted_mean_by_genre.head() # Check the new dataframe
# By bar plot, check correlation of budget, revenue, and profit with genres.
plt.figure(figsize = (6,10))
profit_by_genre_plot = sns.barplot(x='dollars', y='genre', data=melted_mean_by_genre, hue='item', orient='h').set_title(
'Mean of Budget, Revenue, and Profit (in USD) with Genres of Movies from 1960 to 2015')
Conclusion: From this bar graph, it's clear to us that budget, revenue, and profit showed similiar trends with different genres. Among those, Family, Fantasy, SciFi, Animation, Adventure, and Action movies showed higher budget, revenue, and profit; Foreign and Documentary showed lower budget, revenue, and profit.
Summary of conclusion:
Prediction: For the future movies, to make the movie popular, it's possible to make family, fantasy, scifi, animation, adventure, and action movies. It's also promising to use a higher budget to get a higher popularity.
Clarification: Without furthur investigation and more evidence, there is no way to conclude cause and effect reasoning solely from correlation explored in this project.
I want to share three plots from this project.
First is the general correlation plot, it's easy to find out which one has a higher correlation with another one. The second is the profit change with year, which shows how the profit of movies changed with year. The third one is the profit by genre plot, which could give us guide on what genre will make more profits.
correlation_map
yearly_profit
profit_by_genre_plot


Bayelsa, Kogi Elections: Group calls for extension of voting time
by Ayodamola OwoseyeFollowing the late commencement of voting in some of the polling units in Bayelsa and Kogi state, YIAGA Africa has called on INEC to extend the voting time for the gubernatorial election.
The organisation in a press statement made available on its Twitter handle on Saturday said some polling units in both states did not start voting at the slated time due to inadequate logistics.
The press statement was co-signed by the chair, YIAGA AFRICA working group, Hussaini Abdu and the Executive Director, YIAGA AFRICA, Samson Itodo.
Mr Abdu urged INEC to extend the voting time in both states so as to allow the citizens of the state exercise their civic duties.
He said election started late in some of the polling units in both states because of inadequate and late deployment of security officers to accompany INEC officials and the materials to the polling units.
Mr Abdu said the organisation wants INEC to extend the voting period beyond 2 p.m. to 5 p.m. for affected polling units in Bayelsa and 2 p.m. to 4 p.m. for affected polling units in Kogi State.
“This will ensure eligible voters are not disenfranchised,” he said.
YIAGA AFRICA also called on the security agencies to fulfil their constitutional responsibility of ensuring these elections are conducted in a secure environment.


You can customize how Docpress renders your Markdown content to HTML. Place your configuration inside the markdown
setting.
docpress.json
{
"markdown": {
"typographer": true
}
}
All of markdown-it settings are supported.
| Setting | Default | Description |
|---|---|---|
html |
true | Enable HTML tags |
xhtmlOut |
false | Use / to close tags (<br /> ) |
breaks |
false | Convert new lines in paragraphs to line breaks |
langPrefix |
"lang-" | CSS language prefix for fenced blocks |
linkify |
true | Auto-convert URLs to links |
typographer |
true | Replace quotes and such |
quotes |
'“”‘’ | Quotes to use for typograher setting |
highlight |
Function | Syntax highlighting function (uses highlight.js by default) |
You can also put Markdown-it plugins under the markdown.plugins
option. These will allow you to customize Markdown parsing behavior through npm packages; search npm for "markdown-it" to see available plugins.
docpress.json
{
"markdown": {
"plugins": {
"decorate": {}
}
}
}
The names (decorate
in the example) correspond to an npm package prefixed by markdown-it-
. For instance, to load the markdown-it-emoji plugin, use:
"emoji": {}
The value ({}
in the example) are options to be passed onto the plugin. Use {}
when you don't want to pass any options.
To use Markdown plugins, be sure to install them via npm first.
npm init # if you don't have package.json
npm install --save --save-exact markdown-it-emoji
Some officially-endorsed plugins are bundled into docpress-core
already. You can use them without installing via npm.


User Guide¶
The Node class¶
The Node class is the fundemental unit of vntree, it creates node instances. Node instances are composed together to create a tree. The nodes in a tree are linked by specifying the parent of each node. A node consists of the following components, that are specified in order as arguments when the Node class is invoked:
name - a string specifying the name of the node.
parent - a reference to the the parent node. The root node has no parent.
data - an optional dictionary containing node data.
Some points to be noted about the vntree.Node class:
Each node has a childs attribute, which is a list containing the children of the node.
If node.childs=[ ], then node has no children. This type of node is sometimes referred to as a leaf node.
Creating trees¶
with Python code¶
The following code imports the Node class and creates a root (top-level) node:
from vntree import Node
rootnode = Node("root-node")
print(f"The name of the root node is «{rootnode.name}»")
The output from this code is:
The name of the root node is «root-node»
To create a level-2 child node, we need to instantiate a Node specifying the root node as parent:
Node("The first child", rootnode)
print(rootnode.to_texttree())
The to_texttree method invoked on rootnode prints a text representation of the tree:
| root-node
+--| The first child
Note that it is not necessary to retain a reference to non-root nodes, since references to child nodes are retained in the parent childs list. However, it can be convenient to retain an explicit reference to each node when constructing a tree with code. In this case, to create a level-3 child of The first child, we know that the parent in this case is the first child of the root node:
c1 = rootnode.childs[0]
gc1 = Node("first grand-child", c1)
print(rootnode.to_texttree())
The tree now looks like this:
| root-node
+--| The first child
. +--| first grand-child
with a Python dictionary¶
The Node class has a fourth optional argument treedict that creates a tree from a Python dictionary representation:
tdict = {
"name": "ROOT",
"data": {
"meta1": 1234,
},
"childs": [
{
"name": "child1",
"childs": [{"name":"gc1"}, {"name":"gc2"}],
},
{
"name": "child2",
"data": {"test1": "this is test data"},
"childs": [{"name":"another gc", "childs":[{"name":"ggc1"}]} ],
},
]
}
rootnode = Node(treedict=tdict)
print(rootnode.to_texttree())
The tree output from this code is:
| ROOT
+--| child1
. +--| gc1
. +--| gc2
+--| child2
. +--| another gc
. . +--| ggc1
with YAML¶
Creating a tree with a Python dictionary can be inconvenient, due to nesting in childs. An alternative that avoids the nesting problem (apart from explicit Python code), is to use YAML to specify a list of nodes:
yamltree = """
- !Node &root
name: "root node"
parent: null
data:
testval1: 111
testval2: 222
- !Node &n0
name: "child 1"
parent: *root
- !Node &n1
parent: *root
data:
name: "second child"
astring: "testing..."
- !Node &n2
parent: *root
data:
name: "third child"
astring: "testing..."
- !Node
parent: *n1
data:
name: "grand child"
test: 1234
"""
ytree = Node.yaml2tree(yamltree) # NOTE: yaml2tree is a class method invoked on Node
print(ytree.to_texttree())
The tree output from the YAML data is:
| root node
+--| child 1
+--| second child
. +--| grand child
+--| third child
Alternatively, the YAML data can be stored in a file. In this case the yamltree argument specifies the path to the YAML file:
ytree = Node.yaml2tree("/home/stephen/tree-nodes.yaml")
Traverse tree¶
Each node in a vntree can act as a generator, facilitating traveral of the (sub-)tree rooted at the node instance.
top-down traversal¶
For top-down tree traversal (starts at the root node), apply the root node directly in a for loop. For example:
print(rootnode.to_texttree())
for n in rootnode:
print(f"name=«{n.name}» coord={n._coord} level={n._level}")
This code gives output:
| ROOT
+--| child1
. +--| gc1
. +--| gc2
+--| child2
. +--| another gc
. . +--| ggc1
name=«ROOT» coord=() level=1
name=«child1» coord=(0,) level=2
name=«gc1» coord=(0, 0) level=3
name=«gc2» coord=(0, 1) level=3
name=«child2» coord=(1,) level=2
name=«another gc» coord=(1, 0) level=3
name=«ggc1» coord=(1, 0, 0) level=4
bottom-up traversal¶
For bottom-up tree traversal, apply the Python built-in reversed function to the root node in a for loop. For an example using the same tree as the top-down traversal example:
for n in reversed(rootnode):
print(f"name=«{n.name}» coord={n._coord} level={n._level}")
This code gives output:
name=«gc1» coord=(0, 0) level=3
name=«gc2» coord=(0, 1) level=3
name=«child1» coord=(0,) level=2
name=«ggc1» coord=(1, 0, 0) level=4
name=«another gc» coord=(1, 0) level=3
name=«child2» coord=(1,) level=2
name=«ROOT» coord=() level=1
Persistence¶
Save tree¶
A tree can be saved as a Python pickle file. For example:
rootnode.savefile("mytree.vnpkl")
Notes:
It is recommended to use the extension .vnpkl for this type of file.
Invoking savefile on a node instance saves the complete tree.
savefile sets a vntree metadata TreeAttr attribute (_vnpkl_fpath) that contains the full path of the pickle file.
After the first savefile invocation it is not necessary to specify argument filepath again, attribute _vnpkl_fpath will be used instead.
Open tree file¶
A tree can be loaded from a vnpkl file by using the class method openfile as follows:
rootnode = Node.openfile("mytree.vnpkl")
Notes:
openfile is invoked on the class: Node.openfile(filepath)
openfile re-sets the vntree metadata TreeAttr attribute _vnpkl_fpath to the current file path.


Journey To The Center Of The Earth
Author Name
Copyright 2016 AllRights Reserved
Terms & Disclaimer | Privacy Policy | Support |
This is a disclaimer text


Below, you find links to the SeqAn library releases. The releases contain the library and demo source code as well as the API documentation.
| Version | Platform Independent Download |
|---|---|
| @!version.version!@ | #! #! @!f!@ |
On each SeqAn release, the apps are also released in a bundle. The version number is the same as the one of the corresponding SeqAn release. See below for individual app releases.
| Version | Linux | Mac | Windows |
|---|---|---|---|
| @!version.version!@ | @!packages_cell(packages=version.packages['Linux'])!@ @!packages_cell(packages=version.packages['Mac'])!@ @!packages_cell(packages=version.packages['Windows'])!@
The SeqAn apps are also released independently of the apps bundle release. You can find the builds below. The version numbers are independent of any SeqAn release number.
| Version | Linux | Mac | Windows |
|---|---|---|---|
| @!version.version!@ | @!packages_cell(packages=version.packages['Linux'])!@ @!packages_cell(packages=version.packages['Mac'])!@ @!packages_cell(packages=version.packages['Windows'])!@


#each
each
iterates through each element in a data structure. By adding a block, you can specify what changes are made to each element
scrambling_phone_number = [7, 0, 3, 5, 5, 5, 5, 5, 5, 5]
scrambling_phone_number.each { |num| print rand(1..num)}
# => 434112215
#map
map
is identical to each
. The only difference is that map forever changes the data structure it is called on.
scrambling_phone_number.map { |num| num / 3 }
# => [2, 0, 1, 1, 1, 1, 1, 1, 1, 1]
#select
select
iterates through the elements in a data structure, but returns an array of elements that fit conditions you've specified.
area_code = scrambling_phone_number.select { |num| num != 5 }
# => [7, 0, 3]
#inject
inject
returns the sum of or product of all numbers in a data structure. It can add or multiple an extra number (ex: 5)
sum = scrambling_phone_number.inject(0) { |total, num| total += num }
# => 45
sum = scrambling_phone_number.inject(5) { |total, num| total += num }
# => 50


We have bitcoin!
- integrate impactful infrastructures
- implement next-generation interfaces
- enable impactful metrics
- extend out-of-the-box technologies
- strategize bleeding-edge schemas
- unleash back-end action-items
- empower cross-platform networks
- innovate leading-edge metrics
- architect 24/365 mindshare
- whiteboard viral supply-chains
- strategize virtual networks
- syndicate integrated technologies
- harness real-time convergence
- redefine mission-critical platforms


Welcome to Inner City.  Your one goal? Don’t have a nervous breakdown. You can achieve this by making the appropriate choices that provide balance between mental, physical, and emotional health. Get a perfect balance, or watch your character’s “Inner City,” melt. Select a character.
Jaqueline Francis
Mary Court


About Us
Events
Teams
Domains
Mentors
Mettina Varghese
Mentor
Sai Satyaaprakash
Mentor
Mishika Agrawal
Mentor
Mritunjay Ambastha
Mentor
Pushkar Singh
Mentor
Shanu Mishra
Mentor
Swasti Mishra
Mentor
Daivam Thaker
Mentor
Sahana M Setty
Mentor
Harsha vardhan
Mentor
Heads
Kushagra Singh
Corporate Head
Tushar Sharma
Corporate Head
Anushka Garg
Corporate & Technical Head
Anurag Sharma
Corporate Head
Anushka S
Emcee Head
Ayush Kumar
Emcee & Discipline Head
Rusali Saha
Emcee & Content Head
Sudiksha Ghosh
Content & Social Media Head
Shiuli Das
Content Head & Alumni Organiser
Murli Kartik
Alumni Organiser
Aryaman Pandey
Creative Head
Aryan Kumar
Creative Head
Anish Kumar singh
Creative Head
Developers
Pranjay Poddar
Shreyansh Pathak


Checking Spelling Mistakes
The spell check feature is introduced in HTML5 to allow you to check spelling mistakes of the editable text. This feature uses the contentEditable attribute to find spelling mistakes in Web page. The syntax to use the spellcheck attribute is given as follows:
< element spellcheck= [ value ] >
In the preceding syntax, element represents an HTML element and the spellcheck attribute can take any of the following values:
- true: Checks an element for spelling and grammar if its content is editable
- false: Does not check an element for spelling and grammar
- inherit: Specifies that an element inherits the spell check behavior from its parent element
The following code snippet shows an example of using the spellcheck attribute:
< TEXTAREA spellcheck="true" > … … < /TEXTAREA >
Click here for demos to see how to check spelling mistakes:
demo