(1) Apple's market capitalization has exceeded $ 2 trillion (2) I tried to visualize the patents of the world's number one company (3) I was able to reconfirm that I value the interface with the user by using software while being mainly hardware.
What I did was the following 3 steps. (1) Preparation: Extract Apple patents with Google Patents (2) Work 1: Visualization with wordcloud (3) Work 2: Mask with the Apple logo and then match the colors
Apple's market capitalization has exceeded $ 2 trillion. Apple was the first to reach a market capitalization of $ 1 trillion, but this is 2018. Market capitalization has doubled in just three years. There is too much money and the investment destinations are limited. Moreover, when it comes to IT that can be expected to consume nests, the promising thing about Corona is that it is Apple. By the way, Warren Buffett, the world's number one investor, is listed as a major shareholder. As expected!
Now, in order to confirm what is amazing about Apple, I tried to visualize the situation of Apple's intellectual property rights (patents). First, download Apple's US patent application as csv data on Google Patents. In the upper left display of Google Patents, there should be about 20,000 data since 2010, but when downloaded to csv, it is about half, 9,000. I wasn't sure what the maximum number of cases was.
First, load csv with a pandas data frame. When downloading to csv with Google Patents, the extraction condition is on the first line, in this case, https://patents.google.com/?assignee=Apple+Inc.&country=US&after=priority:20100101 Is entered, so set header = 1 when reading.
python
import pandas as pd
df=pd.read_csv("data.csv",header=1)
df.columns
This time, only the patent name (title) is used.
python
Title=df["title"]
Text=''
for i in Title:
Text+=i
Now, wordcloud is finally here.
python
import wordcloud
word_cloud=wordcloud.WordCloud(background_color="white")
word_cloud.generate(Text)
import matplotlib.pyplot as plt
plt.figure(figsize=(16,10))
plt.imshow(word_cloud)
plt.axis("off")
plt.show()
Let's load the text of the patent name prepared earlier into wordcloud and draw it with matplotlib. Then, it becomes as follows.
Use the word you want to remove as an argument as stopwords so that the same word does not appear twice.
python
stopwords={"method","using","portion","thereof","based","multiple","multi","and","of","in","for","with","to","or","providing","on","by","an"}
word_cloud=wordcloud.WordCloud(background_color="white",collocations=False,stopwords=stopwords)
word_cloud.generate(Text)
plt.figure(figsize=(16,10))
plt.imshow(word_cloud)
plt.axis("off")
plt.show()
It was a little refreshing.
Let's mask it with the Apple logo that I personally like. Note that this uses numpy's array.
python
from PIL import Image
import numpy as np
mask_array = np.array(Image.open('Apple.jpg'))
word_cloud=wordcloud.WordCloud(mask=mask_array,background_color="white",collocations=False,stopwords=stopwords)
word_cloud.generate(Text)
plt.figure(figsize=(16,10))
plt.imshow(word_cloud)
plt.axis("off")
plt.show()
The results are as follows. It became like Apple (laughs)
Since it's a big deal, let's make a wordcloud using the color scheme of the Apple logo that shines in rainbow colors.
python
from wordcloud import ImageColorGenerator
image_color = ImageColorGenerator(mask_array)
word_cloud=wordcloud.WordCloud(mask=mask_array,color_func=image_color,background_color="white",collocations=False,stopwords=stopwords)
word_cloud.generate(Text)
plt.figure(figsize=(16,10))
plt.imshow(word_cloud)
plt.axis("off")
plt.show()
At this time, note that the Wordcloud ImageColor Generator is required. The results are as listed at the beginning, but I will repost them. Apple is fashionable: apple:
Apple is amazing. At one point I lost to Microsoft and thought that it would be a PC only for enthusiasts, but I changed the world with the iPhone. But recently, I'm really surprised that the market capitalization has doubled in just three years. It is a fabless company that does not have a factory by fusing hardware and software, and values the user interface, which matches the times.
Recommended Posts