4. pandas使用2

import pandas as pd
import numpy as np

示例 股票数据离散化

stock=pd.read_csv("/home/python/练习/stock_day/stock_day.csv")
stock.head()
openhighcloselowvolumeprice_changep_changema5ma10ma20v_ma5v_ma10v_ma20turnover
2018-02-2723.5325.8824.1623.5395578.030.632.6822.94222.14222.87553782.6446738.6555576.112.39
2018-02-2622.8023.7823.5322.8060985.110.693.0222.40621.95522.94240827.5242736.3456007.501.53
2018-02-2322.8823.3722.8222.7152914.010.542.4221.93821.92923.02235119.5841871.9756372.851.32
2018-02-2222.2522.7622.2822.0236105.010.361.6421.44621.90923.13735397.5839904.7860149.600.90
2018-02-1421.4921.9921.9221.4823331.040.442.0521.36621.92323.25333590.2142935.7461716.110.58
qcut=pd.qcut(stock["p_change"], 10)

qcut.value_counts



<bound method IndexOpsMixin.value_counts of 2018-02-27                   (1.738, 2.938]
2018-02-26                    (2.938, 5.27]
2018-02-23                   (1.738, 2.938]
2018-02-22                    (0.94, 1.738]
2018-02-14                   (1.738, 2.938]
2018-02-13                    (0.94, 1.738]
2018-02-12                    (2.938, 5.27]
2018-02-09    (-10.030999999999999, -4.836]
2018-02-08                     (0.26, 0.94]
2018-02-07                 (-2.444, -1.352]
2018-02-06                 (-4.836, -2.444]
2018-02-05                   (1.738, 2.938]
2018-02-02                     (0.26, 0.94]
2018-02-01    (-10.030999999999999, -4.836]
2018-01-31                   (-0.462, 0.26]
2018-01-30                   (-0.462, 0.26]
2018-01-29                 (-4.836, -2.444]
2018-01-26                     (0.26, 0.94]
2018-01-25                 (-4.836, -2.444]
2018-01-24                 (-1.352, -0.462]
2018-01-23                    (0.94, 1.738]
2018-01-22                   (-0.462, 0.26]
2018-01-19                   (1.738, 2.938]
2018-01-18                   (-0.462, 0.26]
2018-01-17                     (0.26, 0.94]
2018-01-16                    (2.938, 5.27]
2018-01-15                 (-4.836, -2.444]
2018-01-12                   (1.738, 2.938]
2018-01-11                 (-1.352, -0.462]
2018-01-10                 (-1.352, -0.462]
                          ...              
2015-04-13                    (5.27, 10.03]
2015-04-10                 (-1.352, -0.462]
2015-04-09                    (5.27, 10.03]
2015-04-08                    (2.938, 5.27]
2015-04-07                    (5.27, 10.03]
2015-04-03                    (0.94, 1.738]
2015-04-02                     (0.26, 0.94]
2015-04-01                     (0.26, 0.94]
2015-03-31                 (-2.444, -1.352]
2015-03-30                    (2.938, 5.27]
2015-03-27                    (5.27, 10.03]
2015-03-26                 (-2.444, -1.352]
2015-03-25                 (-2.444, -1.352]
2015-03-24                   (1.738, 2.938]
2015-03-23                   (-0.462, 0.26]
2015-03-20                   (-0.462, 0.26]
2015-03-19                     (0.26, 0.94]
2015-03-18                     (0.26, 0.94]
2015-03-17                   (1.738, 2.938]
2015-03-16                   (1.738, 2.938]
2015-03-13                   (1.738, 2.938]
2015-03-12                 (-1.352, -0.462]
2015-03-11                 (-2.444, -1.352]
2015-03-10                   (1.738, 2.938]
2015-03-09                   (-0.462, 0.26]
2015-03-06                    (5.27, 10.03]
2015-03-05                   (1.738, 2.938]
2015-03-04                    (0.94, 1.738]
2015-03-03                    (0.94, 1.738]
2015-03-02                   (1.738, 2.938]
Name: p_change, Length: 643, dtype: category
Categories (10, interval[float64]): [(-10.030999999999999, -4.836] < (-4.836, -2.444] < (-2.444, -1.352] < (-1.352, -0.462] ... (0.94, 1.738] < (1.738, 2.938] < (2.938, 5.27] < (5.27, 10.03]]>



pd.get_dummies(qcut,prefix="rise")
rise_(-10.030999999999999, -4.836]rise_(-4.836, -2.444]rise_(-2.444, -1.352]rise_(-1.352, -0.462]rise_(-0.462, 0.26]rise_(0.26, 0.94]rise_(0.94, 1.738]rise_(1.738, 2.938]rise_(2.938, 5.27]rise_(5.27, 10.03]
2018-02-270000000100
2018-02-260000000010
2018-02-230000000100
2018-02-220000001000
2018-02-140000000100
2018-02-130000001000
2018-02-120000000010
2018-02-091000000000
2018-02-080000010000
2018-02-070010000000
2018-02-060100000000
2018-02-050000000100
2018-02-020000010000
2018-02-011000000000
2018-01-310000100000
2018-01-300000100000
2018-01-290100000000
2018-01-260000010000
2018-01-250100000000
2018-01-240001000000
2018-01-230000001000
2018-01-220000100000
2018-01-190000000100
2018-01-180000100000
2018-01-170000010000
2018-01-160000000010
2018-01-150100000000
2018-01-120000000100
2018-01-110001000000
2018-01-100001000000
.................................
2015-04-130000000001
2015-04-100001000000
2015-04-090000000001
2015-04-080000000010
2015-04-070000000001
2015-04-030000001000
2015-04-020000010000
2015-04-010000010000
2015-03-310010000000
2015-03-300000000010
2015-03-270000000001
2015-03-260010000000
2015-03-250010000000
2015-03-240000000100
2015-03-230000100000
2015-03-200000100000
2015-03-190000010000
2015-03-180000010000
2015-03-170000000100
2015-03-160000000100
2015-03-130000000100
2015-03-120001000000
2015-03-110010000000
2015-03-100000000100
2015-03-090000100000
2015-03-060000000001
2015-03-050000000100
2015-03-040000001000
2015-03-030000001000
2015-03-020000000100

643 rows × 10 columns

bins=[-100,-7,-5,-3,0,3,5,7,100]
cut=pd.cut(stock['p_change'], bins)
cut.value_counts



<bound method IndexOpsMixin.value_counts of 2018-02-27      (0, 3]
2018-02-26      (3, 5]
2018-02-23      (0, 3]
2018-02-22      (0, 3]
2018-02-14      (0, 3]
2018-02-13      (0, 3]
2018-02-12      (3, 5]
2018-02-09    (-7, -5]
2018-02-08      (0, 3]
2018-02-07     (-3, 0]
2018-02-06    (-5, -3]
2018-02-05      (0, 3]
2018-02-02      (0, 3]
2018-02-01    (-7, -5]
2018-01-31     (-3, 0]
2018-01-30      (0, 3]
2018-01-29     (-3, 0]
2018-01-26      (0, 3]
2018-01-25    (-5, -3]
2018-01-24     (-3, 0]
2018-01-23      (0, 3]
2018-01-22     (-3, 0]
2018-01-19      (0, 3]
2018-01-18      (0, 3]
2018-01-17      (0, 3]
2018-01-16      (3, 5]
2018-01-15    (-5, -3]
2018-01-12      (0, 3]
2018-01-11     (-3, 0]
2018-01-10     (-3, 0]
                ...   
2015-04-13    (7, 100]
2015-04-10     (-3, 0]
2015-04-09      (5, 7]
2015-04-08      (5, 7]
2015-04-07      (5, 7]
2015-04-03      (0, 3]
2015-04-02      (0, 3]
2015-04-01      (0, 3]
2015-03-31     (-3, 0]
2015-03-30      (3, 5]
2015-03-27      (5, 7]
2015-03-26     (-3, 0]
2015-03-25     (-3, 0]
2015-03-24      (0, 3]
2015-03-23      (0, 3]
2015-03-20     (-3, 0]
2015-03-19      (0, 3]
2015-03-18      (0, 3]
2015-03-17      (0, 3]
2015-03-16      (0, 3]
2015-03-13      (0, 3]
2015-03-12     (-3, 0]
2015-03-11     (-3, 0]
2015-03-10      (0, 3]
2015-03-09      (0, 3]
2015-03-06    (7, 100]
2015-03-05      (0, 3]
2015-03-04      (0, 3]
2015-03-03      (0, 3]
2015-03-02      (0, 3]
Name: p_change, Length: 643, dtype: category
Categories (8, interval[int64]): [(-100, -7] < (-7, -5] < (-5, -3] < (-3, 0] < (0, 3] < (3, 5] < (5, 7] < (7, 100]]>



one_hot=pd.get_dummies(qcut,prefix="涨跌幅").head()
one_hot
涨跌幅_(-10.030999999999999, -4.836]涨跌幅_(-4.836, -2.444]涨跌幅_(-2.444, -1.352]涨跌幅_(-1.352, -0.462]涨跌幅_(-0.462, 0.26]涨跌幅_(0.26, 0.94]涨跌幅_(0.94, 1.738]涨跌幅_(1.738, 2.938]涨跌幅_(2.938, 5.27]涨跌幅_(5.27, 10.03]
2018-02-270000000100
2018-02-260000000010
2018-02-230000000100
2018-02-220000001000
2018-02-140000000100
# 数据的合并
pd.concat([stock,one_hot],axis=1).head()
openhighcloselowvolumeprice_changep_changema5ma10ma20...涨跌幅_(-10.030999999999999, -4.836]涨跌幅_(-4.836, -2.444]涨跌幅_(-2.444, -1.352]涨跌幅_(-1.352, -0.462]涨跌幅_(-0.462, 0.26]涨跌幅_(0.26, 0.94]涨跌幅_(0.94, 1.738]涨跌幅_(1.738, 2.938]涨跌幅_(2.938, 5.27]涨跌幅_(5.27, 10.03]
2015-03-0212.2512.6712.5212.2096291.730.322.6212.52012.52012.520...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
2015-03-0312.5213.0612.7012.52139071.610.181.4412.61012.61012.610...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
2015-03-0412.8012.9212.9012.6167075.440.201.5712.70712.70712.707...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
2015-03-0512.8813.4513.1612.8793180.390.262.0212.82012.82012.820...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
2015-03-0613.1714.4814.2813.13179831.721.128.5113.11213.11213.112...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN

5 rows × 24 columns

stock
openhighcloselowvolumeprice_changep_changema5ma10ma20v_ma5v_ma10v_ma20turnover
2018-02-2723.5325.8824.1623.5395578.030.632.6822.94222.14222.87553782.6446738.6555576.112.39
2018-02-2622.8023.7823.5322.8060985.110.693.0222.40621.95522.94240827.5242736.3456007.501.53
2018-02-2322.8823.3722.8222.7152914.010.542.4221.93821.92923.02235119.5841871.9756372.851.32
2018-02-2222.2522.7622.2822.0236105.010.361.6421.44621.90923.13735397.5839904.7860149.600.90
2018-02-1421.4921.9921.9221.4823331.040.442.0521.36621.92323.25333590.2142935.7461716.110.58
2018-02-1321.4021.9021.4821.3130802.450.281.3221.34222.10323.38739694.6545518.1465161.680.77
2018-02-1220.7021.4021.1920.6332445.390.824.0321.50422.33823.53344645.1645679.9468686.330.81
2018-02-0921.2021.4620.3620.1954304.01-1.50-6.8621.92022.59623.64548624.3648982.3870552.471.36
2018-02-0821.7922.0921.8821.7527068.160.090.4122.37223.00923.83944411.9848612.1673852.450.68
2018-02-0722.6923.1121.8021.2953853.25-0.50-2.2422.48023.25823.92952281.2856315.1174925.331.35
2018-02-0622.8023.5522.2922.2055555.00-0.97-4.1722.86423.60724.02951341.6364413.5875738.951.39
2018-02-0522.4523.3923.2722.2552341.390.652.8723.17223.92824.11246714.7269278.6677070.001.31
2018-02-0222.4022.7022.6221.5333242.110.200.8923.27224.11424.18449340.4070873.7379929.710.83
2018-02-0123.7123.8622.4222.2266414.64-1.30-5.4823.64624.36524.27952812.3580394.4388480.921.66
2018-01-3123.8523.9823.7223.3149155.02-0.11-0.4624.03624.58324.41160348.9480496.4891666.751.23
2018-01-3023.7124.0823.8323.7032420.430.050.2124.35024.67124.36577485.5384805.2392943.350.81
2018-01-2924.4024.6323.7723.7265469.81-0.73-2.9824.68424.72824.29491842.6091692.7393456.221.64
2018-01-2624.2724.7424.4924.2250601.830.110.4524.95624.69424.22192407.0592122.5691980.511.27
2018-01-2524.9924.9924.3724.23104097.59-0.93-3.6825.08424.66924.109107976.5199092.7392262.672.61
2018-01-2425.4926.2825.2925.20134838.00-0.20-0.7925.13024.59923.997100644.0293535.5589522.223.37
2018-01-2325.1525.5325.5024.93104205.760.391.5524.99224.45023.84492124.9287064.3385876.802.61
2018-01-2225.1425.4025.1324.7568292.08-0.01-0.0424.77224.29623.64491542.8584861.3384970.001.71
2018-01-1924.6025.3425.1324.42128449.110.532.1524.43224.25423.53791838.0788985.7082975.103.21
2018-01-1824.4024.8824.6024.3067435.140.010.0424.25424.19223.44190208.9596567.4178252.921.69
2018-01-1724.4224.9224.6023.8092242.510.200.8224.06824.23923.37886427.08102837.0177049.612.31
2018-01-1623.4024.6024.4023.30101295.420.964.1023.90824.05823.32182003.73101081.4774590.922.54
2018-01-1524.0124.2323.4323.3069768.17-0.80-3.3023.82023.86023.25778179.8195219.7171006.651.75
2018-01-1223.7025.1524.2423.42120303.530.562.3724.07623.74823.23686133.3391838.4669690.353.01
2018-01-1123.6723.8523.6723.2148525.75-0.12-0.5024.13023.54823.197102925.8785432.6165928.231.21
2018-01-1024.1024.6023.8023.4070125.79-0.14-0.5824.41023.39423.204119246.9585508.8966934.891.76
.............................................
2015-04-1319.6021.3021.1319.50171822.691.708.7519.22817.81216.563149620.34114456.84111752.315.88
2015-04-1019.5519.8919.4319.20112962.15-0.19-0.9718.33417.27616.230133648.38109309.78106228.293.87
2015-04-0918.2819.8919.6218.02183119.051.206.5117.73616.82615.964124323.21106501.34104829.106.27
2015-04-0817.6018.5318.4217.60157725.970.885.0217.07016.39415.698101421.2997906.88101658.575.40
2015-04-0716.5417.9817.5416.50122471.850.885.2816.62016.12015.51086769.6297473.2998832.944.19
2015-04-0316.4416.7716.6616.2591962.880.221.3416.39615.90415.34879293.3494172.2499956.633.15
2015-04-0216.2116.5016.4416.2166336.320.150.9216.21815.77215.22984971.1992655.96104350.082.27
2015-04-0116.1816.4816.2916.0068609.420.120.7415.91615.66615.06588679.4795386.75105692.282.35
2015-03-3116.7816.8816.1716.0784467.62-0.25-1.5215.71815.56814.89694392.47100679.68105615.582.89
2015-03-3015.9916.6316.4215.9985090.450.654.1215.62015.46914.722108176.96108109.99108345.782.91
2015-03-2714.9015.8615.7714.90120352.130.845.6315.41215.31414.527109051.14109047.78108905.844.12
2015-03-2615.1415.3514.9314.9184877.75-0.37-2.4215.32615.18414.462100340.74103146.79108303.412.91
2015-03-2515.9715.9715.3015.1897174.40-0.38-2.4215.41615.10214.436102094.02103156.85109604.833.33
2015-03-2415.3816.1615.6815.28153390.080.301.9515.41815.00214.385106966.89105410.25110336.035.25
2015-03-2315.3415.5615.3815.2589461.320.040.2615.31814.89914.304108043.02100192.60107645.163.06
2015-03-2015.3815.4815.3415.1876800.13-0.04-0.2615.21614.79214.232109044.42105741.03108857.412.63
2015-03-1915.2015.6415.3815.1193644.190.070.4615.04214.68614.153105952.84116044.19111147.223.21
2015-03-1815.1815.6615.3115.02121538.710.130.8614.78814.46414.058104219.67115997.81112493.604.16
2015-03-1714.9015.4415.1814.63158770.770.312.0814.58614.22313.954103853.62110551.48111739.855.43
2015-03-1614.5215.0514.8714.5194468.300.402.7614.48013.97513.84392342.17108581.56107464.313.23
2015-03-1314.1314.5014.4714.0861342.220.362.5514.36813.74013.740102437.64108763.91108763.912.10
2015-03-1214.1114.8014.1113.9584978.37-0.19-1.3314.33013.65913.659126135.54114032.98114032.982.91
2015-03-1114.8015.0814.3014.14119708.43-0.35-2.3914.14013.60313.603127775.94117664.81117664.814.10
2015-03-1014.2014.8014.6514.01101213.510.342.3813.86013.50313.503117249.34117372.87117372.873.46
2015-03-0914.1414.8514.3113.80144945.660.030.2113.47013.31213.312124820.96120066.09120066.094.96
2015-03-0613.1714.4814.2813.13179831.721.128.5113.11213.11213.112115090.18115090.18115090.186.16
2015-03-0512.8813.4513.1612.8793180.390.262.0212.82012.82012.82098904.7998904.7998904.793.19
2015-03-0412.8012.9212.9012.6167075.440.201.5712.70712.70712.707100812.93100812.93100812.932.30
2015-03-0312.5213.0612.7012.52139071.610.181.4412.61012.61012.610117681.67117681.67117681.674.76
2015-03-0212.2512.6712.5212.2096291.730.322.6212.52012.52012.52096291.7396291.7396291.733.30

643 rows × 14 columns

# 1、先根据对应的日期找到星期几
date = pd.to_datetime(stock.index).weekday
stock['week'] = date

# 2、把p_change按照大小分类,以0为界限
stock['posi_neg'] = np.where(stock['p_change'] > 0, 1, 0)

# 通过交叉表找寻两列数据的关系
data = pd.crosstab(stock['week'], stock['posi_neg'])

data
posi_neg01
week
06362
15576
26171
36365
45968
pona_sum=data.sum(axis=1)

pona_sum



week
0    125
1    131
2    132
3    128
4    127
dtype: int64



data=data.div(pona_sum,axis=0)
data
posi_neg01
week
00.5040000.496000
10.4198470.580153
20.4621210.537879
30.4921880.507812
40.4645670.535433
data.plot(kind="bar",stacked=True)



<matplotlib.axes._subplots.AxesSubplot at 0x7f8cd40efeb8>



# 透视表实现更加简单
 stock.pivot_table(["posi_neg"],index=["week"])
posi_neg
week
00.496000
10.580153
20.537879
30.507812
40.535433
# 分组
col =pd.DataFrame({'color': ['white','red','green','red','green'], 'object': ['pen','pencil','pencil','ashtray','pen'],'price1':[5.56,4.20,1.30,0.56,2.75],'price2':[4.75,4.12,1.60,0.75,3.15]})

col
colorobjectprice1price2
0whitepen5.564.75
1redpencil4.204.12
2greenpencil1.301.60
3redashtray0.560.75
4greenpen2.753.15
col.groupby(['color'])['price1'].mean()




color
green    2.025
red      2.380
white    5.560
Name: price1, dtype: float64



col.groupby(['color'], as_index=False)['price1'].mean()
colorprice1
0green2.025
1red2.380
2white5.560

综合示例

movie=pd.read_csv("/home/python/练习/IMDB/IMDB-Movie-Data.csv")

movie.head()
RankTitleGenreDescriptionDirectorActorsYearRuntime (Minutes)RatingVotesRevenue (Millions)Metascore
01Guardians of the GalaxyAction,Adventure,Sci-FiA group of intergalactic criminals are forced ...James GunnChris Pratt, Vin Diesel, Bradley Cooper, Zoe S...20141218.1757074333.1376.0
12PrometheusAdventure,Mystery,Sci-FiFollowing clues to the origin of mankind, a te...Ridley ScottNoomi Rapace, Logan Marshall-Green, Michael Fa...20121247.0485820126.4665.0
23SplitHorror,ThrillerThree girls are kidnapped by a man with a diag...M. Night ShyamalanJames McAvoy, Anya Taylor-Joy, Haley Lu Richar...20161177.3157606138.1262.0
34SingAnimation,Comedy,FamilyIn a city of humanoid animals, a hustling thea...Christophe LourdeletMatthew McConaughey,Reese Witherspoon, Seth Ma...20161087.260545270.3259.0
45Suicide SquadAction,Adventure,FantasyA secret government agency recruits some of th...David AyerWill Smith, Jared Leto, Margot Robbie, Viola D...20161236.2393727325.0240.0
# 想知道这些电影数据中评分的平均分,导演的人数等信息,我们应该怎么获取?

mean=movie["Rating"].mean()
print("电影平均分为{}".format(mean))

电影平均分为6.723199999999999



director_count=movie["Director"].unique().size
print("共有{}名导演".format(director_count))

共有644名导演



# 2 对于这一组电影数据,如果我们想看Rating,Runtime (Minutes)的分布情况,应该如何呈现数据?

movie["Rating"].plot(kind="hist",figsize=(20,8),bins=20)



<matplotlib.axes._subplots.AxesSubplot at 0x7f8cd1b40b38>







import matplotlib.pyplot as plt
plt.figure(figsize=(20,8),dpi=80)
plt.hist(movie["Rating"].values,bins=20)
 #求出最大最小值
max_ = movie["Rating"].max()
min_ = movie["Rating"].min()

# 生成刻度列表
t1 = np.linspace(min_,max_,num=21)

# [ 1.9    2.255  2.61   2.965  3.32   3.675  4.03   4.385  4.74   5.095  5.45   5.805  6.16   6.515  6.87   7.225  7.58   7.935  8.29   8.645  9.   ]

# 修改刻度
plt.xticks(np.linspace(min_,max_,num=21))

# 添加网格
plt.grid()

plt.show()





# 3 对于这一组电影数据,如果我们希望统计电影分类(genre)的情况,应该如何处理数据?

movie.head()
RankTitleGenreDescriptionDirectorActorsYearRuntime (Minutes)RatingVotesRevenue (Millions)Metascore
01Guardians of the GalaxyAction,Adventure,Sci-FiA group of intergalactic criminals are forced ...James GunnChris Pratt, Vin Diesel, Bradley Cooper, Zoe S...20141218.1757074333.1376.0
12PrometheusAdventure,Mystery,Sci-FiFollowing clues to the origin of mankind, a te...Ridley ScottNoomi Rapace, Logan Marshall-Green, Michael Fa...20121247.0485820126.4665.0
23SplitHorror,ThrillerThree girls are kidnapped by a man with a diag...M. Night ShyamalanJames McAvoy, Anya Taylor-Joy, Haley Lu Richar...20161177.3157606138.1262.0
34SingAnimation,Comedy,FamilyIn a city of humanoid animals, a hustling thea...Christophe LourdeletMatthew McConaughey,Reese Witherspoon, Seth Ma...20161087.260545270.3259.0
45Suicide SquadAction,Adventure,FantasyA secret government agency recruits some of th...David AyerWill Smith, Jared Leto, Margot Robbie, Viola D...20161236.2393727325.0240.0
# 先获取类别的清单
class_list=[i.split(",")for i in movie["Genre"]]

class_list



[['Action', 'Adventure', 'Sci-Fi'],
 ['Adventure', 'Mystery', 'Sci-Fi'],
 ['Horror', 'Thriller'],
 ['Animation', 'Comedy', 'Family'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Comedy', 'Drama', 'Music'],
 ['Comedy'],
 ['Action', 'Adventure', 'Biography'],
 ['Adventure', 'Drama', 'Romance'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Biography', 'Drama', 'History'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Action', 'Comedy', 'Drama'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Biography', 'Drama', 'History'],
 ['Action', 'Thriller'],
 ['Biography', 'Drama'],
 ['Drama', 'Mystery', 'Sci-Fi'],
 ['Adventure', 'Drama', 'Thriller'],
 ['Drama'],
 ['Crime', 'Drama', 'Horror'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Comedy'],
 ['Action', 'Adventure', 'Drama'],
 ['Horror', 'Thriller'],
 ['Comedy'],
 ['Action', 'Adventure', 'Drama'],
 ['Comedy'],
 ['Drama', 'Thriller'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Adventure', 'Comedy'],
 ['Action', 'Horror', 'Sci-Fi'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Adventure', 'Drama', 'Sci-Fi'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Action', 'Adventure', 'Western'],
 ['Comedy', 'Drama'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Drama'],
 ['Horror'],
 ['Biography', 'Drama', 'History'],
 ['Drama'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Drama', 'Thriller'],
 ['Adventure', 'Drama', 'Fantasy'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Drama'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Comedy', 'Drama'],
 ['Action', 'Crime', 'Thriller'],
 ['Action', 'Crime', 'Drama'],
 ['Adventure', 'Drama', 'History'],
 ['Crime', 'Horror', 'Thriller'],
 ['Drama', 'Romance'],
 ['Comedy', 'Drama', 'Romance'],
 ['Biography', 'Drama'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Horror', 'Mystery', 'Thriller'],
 ['Crime', 'Drama', 'Mystery'],
 ['Drama', 'Romance', 'Thriller'],
 ['Drama', 'Mystery', 'Sci-Fi'],
 ['Action', 'Adventure', 'Comedy'],
 ['Drama', 'History', 'Thriller'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Drama'],
 ['Action', 'Drama', 'Thriller'],
 ['Drama', 'History'],
 ['Action', 'Drama', 'Romance'],
 ['Drama', 'Fantasy'],
 ['Drama', 'Romance'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Action', 'Sci-Fi'],
 ['Adventure', 'Drama', 'War'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Action', 'Comedy', 'Fantasy'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Comedy', 'Drama'],
 ['Biography', 'Comedy', 'Crime'],
 ['Crime', 'Drama', 'Mystery'],
 ['Action', 'Crime', 'Thriller'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Crime', 'Drama'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Crime', 'Drama', 'Mystery'],
 ['Action', 'Crime', 'Drama'],
 ['Crime', 'Drama', 'Mystery'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Drama'],
 ['Comedy', 'Crime', 'Drama'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Comedy', 'Crime'],
 ['Animation', 'Drama', 'Fantasy'],
 ['Horror', 'Mystery', 'Sci-Fi'],
 ['Drama', 'Mystery', 'Thriller'],
 ['Crime', 'Drama', 'Thriller'],
 ['Biography', 'Crime', 'Drama'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Adventure', 'Drama', 'Sci-Fi'],
 ['Crime', 'Mystery', 'Thriller'],
 ['Action', 'Adventure', 'Comedy'],
 ['Crime', 'Drama', 'Thriller'],
 ['Comedy'],
 ['Action', 'Adventure', 'Drama'],
 ['Drama'],
 ['Drama', 'Mystery', 'Sci-Fi'],
 ['Action', 'Horror', 'Thriller'],
 ['Biography', 'Drama', 'History'],
 ['Romance', 'Sci-Fi'],
 ['Action', 'Fantasy', 'War'],
 ['Adventure', 'Drama', 'Fantasy'],
 ['Comedy'],
 ['Horror', 'Thriller'],
 ['Action', 'Biography', 'Drama'],
 ['Drama', 'Horror', 'Mystery'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Adventure', 'Drama', 'Family'],
 ['Adventure', 'Mystery', 'Sci-Fi'],
 ['Adventure', 'Comedy', 'Romance'],
 ['Action'],
 ['Action', 'Thriller'],
 ['Adventure', 'Drama', 'Family'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Adventure', 'Crime', 'Mystery'],
 ['Comedy', 'Family', 'Musical'],
 ['Adventure', 'Drama', 'Thriller'],
 ['Drama'],
 ['Adventure', 'Comedy', 'Drama'],
 ['Drama', 'Horror', 'Thriller'],
 ['Drama', 'Music'],
 ['Action', 'Crime', 'Thriller'],
 ['Crime', 'Drama', 'Thriller'],
 ['Crime', 'Drama', 'Thriller'],
 ['Drama', 'Romance'],
 ['Mystery', 'Thriller'],
 ['Mystery', 'Thriller', 'Western'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Comedy', 'Family'],
 ['Biography', 'Comedy', 'Drama'],
 ['Drama'],
 ['Drama', 'Western'],
 ['Drama', 'Mystery', 'Romance'],
 ['Comedy', 'Drama'],
 ['Action', 'Drama', 'Mystery'],
 ['Comedy'],
 ['Action', 'Adventure', 'Crime'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Adventure', 'Sci-Fi', 'Thriller'],
 ['Drama'],
 ['Action', 'Crime', 'Drama'],
 ['Drama', 'Horror', 'Mystery'],
 ['Action', 'Horror', 'Sci-Fi'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Comedy', 'Drama', 'Romance'],
 ['Action', 'Comedy', 'Fantasy'],
 ['Action', 'Comedy', 'Mystery'],
 ['Thriller', 'War'],
 ['Action', 'Comedy', 'Crime'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Adventure', 'Crime'],
 ['Action', 'Adventure', 'Thriller'],
 ['Drama', 'Fantasy', 'Romance'],
 ['Action', 'Adventure', 'Comedy'],
 ['Biography', 'Drama', 'History'],
 ['Action', 'Drama', 'History'],
 ['Action', 'Adventure', 'Thriller'],
 ['Crime', 'Drama', 'Thriller'],
 ['Animation', 'Adventure', 'Family'],
 ['Adventure', 'Horror'],
 ['Drama', 'Romance', 'Sci-Fi'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Action', 'Adventure', 'Family'],
 ['Action', 'Adventure', 'Drama'],
 ['Action', 'Comedy'],
 ['Horror', 'Mystery', 'Thriller'],
 ['Action', 'Adventure', 'Comedy'],
 ['Comedy', 'Romance'],
 ['Horror', 'Mystery'],
 ['Drama', 'Family', 'Fantasy'],
 ['Sci-Fi'],
 ['Drama', 'Thriller'],
 ['Drama', 'Romance'],
 ['Drama', 'War'],
 ['Drama', 'Fantasy', 'Horror'],
 ['Crime', 'Drama'],
 ['Comedy', 'Drama', 'Romance'],
 ['Drama', 'Romance'],
 ['Drama'],
 ['Crime', 'Drama', 'History'],
 ['Horror', 'Sci-Fi', 'Thriller'],
 ['Action', 'Drama', 'Sport'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Crime', 'Drama', 'Thriller'],
 ['Adventure', 'Biography', 'Drama'],
 ['Biography', 'Drama', 'Thriller'],
 ['Action', 'Comedy', 'Crime'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Drama', 'Fantasy', 'Horror'],
 ['Biography', 'Drama', 'Thriller'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Adventure', 'Mystery'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Drama', 'Horror'],
 ['Comedy', 'Drama', 'Romance'],
 ['Comedy', 'Romance'],
 ['Drama', 'Horror', 'Thriller'],
 ['Action', 'Adventure', 'Drama'],
 ['Drama'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Drama', 'Mystery'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Adventure', 'Comedy'],
 ['Drama', 'Horror'],
 ['Action', 'Comedy'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Horror', 'Mystery'],
 ['Crime', 'Drama', 'Mystery'],
 ['Comedy', 'Crime'],
 ['Drama'],
 ['Comedy', 'Drama', 'Romance'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Adventure', 'Family'],
 ['Horror', 'Sci-Fi', 'Thriller'],
 ['Drama', 'Fantasy', 'War'],
 ['Crime', 'Drama', 'Thriller'],
 ['Action', 'Adventure', 'Drama'],
 ['Action', 'Adventure', 'Thriller'],
 ['Action', 'Adventure', 'Drama'],
 ['Drama', 'Romance'],
 ['Biography', 'Drama', 'History'],
 ['Drama', 'Horror', 'Thriller'],
 ['Adventure', 'Comedy', 'Drama'],
 ['Action', 'Adventure', 'Romance'],
 ['Action', 'Drama', 'War'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Drama', 'Musical', 'Romance'],
 ['Drama', 'Sci-Fi', 'Thriller'],
 ['Comedy', 'Drama'],
 ['Action', 'Comedy', 'Crime'],
 ['Biography', 'Comedy', 'Drama'],
 ['Comedy', 'Drama', 'Romance'],
 ['Drama', 'Thriller'],
 ['Biography', 'Drama', 'History'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Horror', 'Mystery', 'Thriller'],
 ['Comedy'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Drama', 'Sci-Fi'],
 ['Horror'],
 ['Drama', 'Thriller'],
 ['Comedy', 'Drama', 'Romance'],
 ['Drama', 'Thriller'],
 ['Comedy', 'Drama'],
 ['Drama'],
 ['Action', 'Adventure', 'Comedy'],
 ['Drama', 'Horror', 'Thriller'],
 ['Comedy'],
 ['Drama', 'Sci-Fi'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Horror'],
 ['Action', 'Adventure', 'Thriller'],
 ['Adventure', 'Fantasy'],
 ['Action', 'Comedy', 'Crime'],
 ['Comedy', 'Drama', 'Music'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Action', 'Adventure', 'Mystery'],
 ['Action', 'Comedy', 'Crime'],
 ['Crime', 'Drama', 'History'],
 ['Comedy'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Crime', 'Mystery', 'Thriller'],
 ['Action', 'Adventure', 'Crime'],
 ['Thriller'],
 ['Biography', 'Drama', 'Romance'],
 ['Action', 'Adventure'],
 ['Action', 'Fantasy'],
 ['Action', 'Comedy'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Comedy', 'Crime'],
 ['Thriller'],
 ['Action', 'Drama', 'Horror'],
 ['Comedy', 'Music', 'Romance'],
 ['Comedy'],
 ['Drama'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Drama', 'Romance'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Comedy', 'Drama'],
 ['Biography', 'Crime', 'Drama'],
 ['Drama', 'History'],
 ['Action', 'Crime', 'Thriller'],
 ['Action', 'Biography', 'Drama'],
 ['Horror'],
 ['Comedy', 'Romance'],
 ['Comedy', 'Romance'],
 ['Comedy', 'Crime', 'Drama'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Crime', 'Drama', 'Thriller'],
 ['Action', 'Crime', 'Thriller'],
 ['Comedy', 'Romance'],
 ['Biography', 'Drama', 'Sport'],
 ['Drama', 'Romance'],
 ['Drama', 'Horror'],
 ['Adventure', 'Fantasy'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Action', 'Drama', 'Sci-Fi'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Horror'],
 ['Comedy', 'Horror', 'Thriller'],
 ['Action', 'Crime', 'Thriller'],
 ['Crime', 'Drama', 'Music'],
 ['Drama'],
 ['Action', 'Crime', 'Thriller'],
 ['Action', 'Sci-Fi', 'Thriller'],
 ['Biography', 'Drama'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Drama', 'Horror', 'Sci-Fi'],
 ['Biography', 'Comedy', 'Drama'],
 ['Crime', 'Horror', 'Thriller'],
 ['Crime', 'Drama', 'Mystery'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Action', 'Biography', 'Drama'],
 ['Biography', 'Drama'],
 ['Biography', 'Drama', 'History'],
 ['Action', 'Biography', 'Drama'],
 ['Drama', 'Fantasy', 'Horror'],
 ['Comedy', 'Drama', 'Romance'],
 ['Drama', 'Sport'],
 ['Drama', 'Romance'],
 ['Comedy', 'Romance'],
 ['Action', 'Crime', 'Thriller'],
 ['Action', 'Crime', 'Drama'],
 ['Action', 'Drama', 'Thriller'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Action', 'Adventure'],
 ['Action', 'Adventure', 'Romance'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Crime', 'Drama'],
 ['Comedy', 'Horror'],
 ['Comedy', 'Fantasy', 'Romance'],
 ['Drama'],
 ['Drama'],
 ['Comedy', 'Drama'],
 ['Comedy', 'Drama', 'Romance'],
 ['Adventure', 'Sci-Fi', 'Thriller'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Comedy', 'Drama'],
 ['Biography', 'Drama', 'Romance'],
 ['Comedy', 'Fantasy'],
 ['Comedy', 'Drama', 'Fantasy'],
 ['Comedy'],
 ['Horror', 'Thriller'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Adventure', 'Comedy', 'Horror'],
 ['Comedy', 'Mystery'],
 ['Drama'],
 ['Adventure', 'Drama', 'Fantasy'],
 ['Drama', 'Sport'],
 ['Action', 'Adventure'],
 ['Action', 'Adventure', 'Drama'],
 ['Action', 'Drama', 'Sci-Fi'],
 ['Action', 'Mystery', 'Sci-Fi'],
 ['Action', 'Crime', 'Drama'],
 ['Action', 'Crime', 'Fantasy'],
 ['Biography', 'Comedy', 'Drama'],
 ['Action', 'Crime', 'Thriller'],
 ['Biography', 'Crime', 'Drama'],
 ['Drama', 'Sport'],
 ['Adventure', 'Comedy', 'Drama'],
 ['Action', 'Adventure', 'Thriller'],
 ['Comedy', 'Fantasy', 'Horror'],
 ['Drama', 'Sport'],
 ['Horror', 'Thriller'],
 ['Drama', 'History', 'Thriller'],
 ['Animation', 'Action', 'Adventure'],
 ['Action', 'Adventure', 'Drama'],
 ['Action', 'Comedy', 'Family'],
 ['Action', 'Adventure', 'Drama'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Comedy'],
 ['Action', 'Crime', 'Drama'],
 ['Biography', 'Drama'],
 ['Comedy', 'Romance'],
 ['Comedy'],
 ['Drama', 'Fantasy', 'Romance'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Comedy'],
 ['Comedy', 'Sci-Fi'],
 ['Comedy', 'Drama'],
 ['Animation', 'Action', 'Adventure'],
 ['Horror'],
 ['Action', 'Biography', 'Crime'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Drama', 'Romance'],
 ['Drama', 'Mystery', 'Thriller'],
 ['Drama', 'History', 'Thriller'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Adventure', 'Comedy'],
 ['Action', 'Thriller'],
 ['Comedy', 'Music'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Crime', 'Drama', 'Thriller'],
 ['Action', 'Adventure', 'Crime'],
 ['Comedy', 'Drama', 'Horror'],
 ['Drama'],
 ['Drama', 'Mystery', 'Romance'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Drama'],
 ['Action', 'Drama', 'Thriller'],
 ['Drama'],
 ['Action', 'Horror', 'Romance'],
 ['Action', 'Drama', 'Fantasy'],
 ['Action', 'Crime', 'Drama'],
 ['Drama', 'Fantasy', 'Romance'],
 ['Action', 'Crime', 'Thriller'],
 ['Action', 'Mystery', 'Thriller'],
 ['Horror', 'Mystery', 'Thriller'],
 ['Action', 'Horror', 'Sci-Fi'],
 ['Comedy', 'Drama'],
 ['Comedy'],
 ['Action', 'Adventure', 'Horror'],
 ['Action', 'Adventure', 'Thriller'],
 ['Action', 'Crime', 'Drama'],
 ['Comedy', 'Crime', 'Drama'],
 ['Drama', 'Romance'],
 ['Drama', 'Thriller'],
 ['Action', 'Comedy', 'Crime'],
 ['Comedy'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Drama', 'Romance'],
 ['Animation', 'Family', 'Fantasy'],
 ['Drama', 'Romance'],
 ['Thriller'],
 ['Adventure', 'Horror', 'Mystery'],
 ['Action', 'Sci-Fi'],
 ['Adventure', 'Comedy', 'Drama'],
 ['Animation', 'Action', 'Adventure'],
 ['Drama', 'Horror'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Comedy', 'Drama'],
 ['Action', 'Horror', 'Mystery'],
 ['Action', 'Thriller'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Drama'],
 ['Comedy', 'Drama', 'Romance'],
 ['Comedy', 'Crime'],
 ['Comedy', 'Romance'],
 ['Drama', 'Romance'],
 ['Crime', 'Drama', 'Thriller'],
 ['Horror', 'Mystery', 'Thriller'],
 ['Biography', 'Drama'],
 ['Drama', 'Mystery', 'Sci-Fi'],
 ['Adventure', 'Comedy', 'Family'],
 ['Action', 'Adventure', 'Crime'],
 ['Action', 'Crime', 'Mystery'],
 ['Mystery', 'Thriller'],
 ['Action', 'Sci-Fi', 'Thriller'],
 ['Action', 'Comedy', 'Crime'],
 ['Biography', 'Crime', 'Drama'],
 ['Biography', 'Drama', 'History'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Biography', 'Drama', 'History'],
 ['Biography', 'Comedy', 'Drama'],
 ['Drama', 'Thriller'],
 ['Horror', 'Thriller'],
 ['Drama'],
 ['Drama', 'War'],
 ['Comedy', 'Drama', 'Romance'],
 ['Drama', 'Romance', 'Sci-Fi'],
 ['Action', 'Crime', 'Drama'],
 ['Comedy', 'Drama'],
 ['Animation', 'Action', 'Adventure'],
 ['Adventure', 'Comedy', 'Drama'],
 ['Comedy', 'Drama', 'Family'],
 ['Drama', 'Romance', 'Thriller'],
 ['Comedy', 'Crime', 'Drama'],
 ['Animation', 'Comedy', 'Family'],
 ['Drama', 'Horror', 'Sci-Fi'],
 ['Action', 'Adventure', 'Drama'],
 ['Action', 'Horror', 'Sci-Fi'],
 ['Action', 'Crime', 'Sport'],
 ['Drama', 'Horror', 'Sci-Fi'],
 ['Drama', 'Horror', 'Sci-Fi'],
 ['Action', 'Adventure', 'Comedy'],
 ['Mystery', 'Sci-Fi', 'Thriller'],
 ['Crime', 'Drama', 'Thriller'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Action', 'Sci-Fi', 'Thriller'],
 ['Drama', 'Romance'],
 ['Crime', 'Drama', 'Thriller'],
 ['Comedy', 'Drama', 'Music'],
 ['Drama', 'Fantasy', 'Romance'],
 ['Crime', 'Drama', 'Thriller'],
 ['Crime', 'Drama', 'Thriller'],
 ['Comedy', 'Drama', 'Romance'],
 ['Comedy', 'Romance'],
 ['Drama', 'Sci-Fi', 'Thriller'],
 ['Drama', 'War'],
 ['Action', 'Crime', 'Drama'],
 ['Sci-Fi', 'Thriller'],
 ['Adventure', 'Drama', 'Horror'],
 ['Comedy', 'Drama', 'Music'],
 ['Comedy', 'Drama', 'Romance'],
 ['Action', 'Adventure', 'Drama'],
 ['Action', 'Crime', 'Drama'],
 ['Adventure', 'Fantasy'],
 ['Drama', 'Romance'],
 ['Biography', 'History', 'Thriller'],
 ['Crime', 'Drama', 'Thriller'],
 ['Action', 'Drama', 'History'],
 ['Biography', 'Comedy', 'Drama'],
 ['Crime', 'Drama', 'Thriller'],
 ['Action', 'Biography', 'Drama'],
 ['Action', 'Drama', 'Sci-Fi'],
 ['Adventure', 'Horror'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Adventure', 'Mystery'],
 ['Comedy', 'Drama', 'Romance'],
 ['Horror', 'Thriller'],
 ['Action', 'Sci-Fi', 'Thriller'],
 ['Action', 'Sci-Fi', 'Thriller'],
 ['Biography', 'Drama'],
 ['Action', 'Crime', 'Drama'],
 ['Action', 'Crime', 'Mystery'],
 ['Action', 'Adventure', 'Comedy'],
 ['Crime', 'Drama', 'Thriller'],
 ['Crime', 'Drama'],
 ['Mystery', 'Thriller'],
 ['Mystery', 'Sci-Fi', 'Thriller'],
 ['Action', 'Mystery', 'Sci-Fi'],
 ['Drama', 'Romance'],
 ['Drama', 'Thriller'],
 ['Drama', 'Mystery', 'Sci-Fi'],
 ['Comedy', 'Drama'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Biography', 'Drama', 'Sport'],
 ['Drama'],
 ['Comedy', 'Drama', 'Romance'],
 ['Biography', 'Drama', 'Romance'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Drama', 'Sci-Fi', 'Thriller'],
 ['Drama', 'Romance', 'Thriller'],
 ['Mystery', 'Thriller'],
 ['Mystery', 'Thriller'],
 ['Action', 'Drama', 'Fantasy'],
 ['Action', 'Adventure', 'Biography'],
 ['Adventure', 'Comedy', 'Sci-Fi'],
 ['Action', 'Adventure', 'Thriller'],
 ['Fantasy', 'Horror'],
 ['Horror', 'Mystery'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Action', 'Adventure', 'Drama'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Comedy', 'Drama'],
 ['Comedy', 'Drama'],
 ['Crime', 'Drama', 'Thriller'],
 ['Comedy', 'Romance'],
 ['Animation', 'Comedy', 'Family'],
 ['Comedy', 'Drama'],
 ['Comedy', 'Drama'],
 ['Biography', 'Drama', 'Sport'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Action', 'Drama', 'History'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Adventure', 'Mystery'],
 ['Crime', 'Drama', 'Mystery'],
 ['Action'],
 ['Action', 'Adventure', 'Family'],
 ['Comedy', 'Romance'],
 ['Comedy', 'Drama', 'Romance'],
 ['Biography', 'Drama', 'Sport'],
 ['Action', 'Fantasy', 'Thriller'],
 ['Biography', 'Drama', 'Sport'],
 ['Action', 'Drama', 'Fantasy'],
 ['Adventure', 'Sci-Fi', 'Thriller'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Drama', 'Mystery', 'Thriller'],
 ['Drama', 'Romance'],
 ['Crime', 'Drama', 'Mystery'],
 ['Comedy', 'Romance', 'Sport'],
 ['Comedy', 'Family'],
 ['Drama', 'Horror', 'Mystery'],
 ['Action', 'Drama', 'Sport'],
 ['Action', 'Adventure', 'Comedy'],
 ['Drama', 'Mystery', 'Sci-Fi'],
 ['Animation', 'Action', 'Comedy'],
 ['Action', 'Crime', 'Drama'],
 ['Action', 'Crime', 'Drama'],
 ['Comedy', 'Drama', 'Romance'],
 ['Animation', 'Action', 'Adventure'],
 ['Crime', 'Drama'],
 ['Drama'],
 ['Drama'],
 ['Comedy', 'Crime'],
 ['Drama'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Drama', 'Fantasy', 'Romance'],
 ['Comedy', 'Drama'],
 ['Drama', 'Fantasy', 'Thriller'],
 ['Biography', 'Crime', 'Drama'],
 ['Comedy', 'Drama', 'Romance'],
 ['Action', 'Crime', 'Drama'],
 ['Sci-Fi'],
 ['Action', 'Biography', 'Drama'],
 ['Action', 'Comedy', 'Romance'],
 ['Adventure', 'Comedy', 'Drama'],
 ['Comedy', 'Crime', 'Drama'],
 ['Action', 'Fantasy', 'Horror'],
 ['Drama', 'Horror'],
 ['Horror'],
 ['Action', 'Thriller'],
 ['Action', 'Adventure', 'Mystery'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Comedy', 'Drama', 'Romance'],
 ['Crime', 'Drama', 'Mystery'],
 ['Adventure', 'Comedy', 'Family'],
 ['Comedy', 'Drama', 'Romance'],
 ['Comedy'],
 ['Comedy', 'Drama', 'Horror'],
 ['Drama', 'Horror', 'Thriller'],
 ['Animation', 'Adventure', 'Family'],
 ['Comedy', 'Romance'],
 ['Mystery', 'Romance', 'Sci-Fi'],
 ['Crime', 'Drama'],
 ['Drama', 'Horror', 'Mystery'],
 ['Comedy'],
 ['Biography', 'Drama'],
 ['Comedy', 'Drama', 'Thriller'],
 ['Comedy', 'Western'],
 ['Drama', 'History', 'War'],
 ['Drama', 'Horror', 'Sci-Fi'],
 ['Drama'],
 ['Comedy', 'Drama'],
 ['Fantasy', 'Horror', 'Thriller'],
 ['Drama', 'Romance'],
 ['Action', 'Comedy', 'Fantasy'],
 ['Drama', 'Horror', 'Musical'],
 ['Crime', 'Drama', 'Mystery'],
 ['Horror', 'Mystery', 'Thriller'],
 ['Comedy', 'Music'],
 ['Drama'],
 ['Biography', 'Crime', 'Drama'],
 ['Drama'],
 ['Action', 'Adventure', 'Comedy'],
 ['Crime', 'Drama', 'Mystery'],
 ['Drama'],
 ['Action', 'Comedy', 'Crime'],
 ['Comedy', 'Drama', 'Romance'],
 ['Crime', 'Drama', 'Mystery'],
 ['Action', 'Comedy', 'Crime'],
 ['Drama'],
 ['Drama', 'Romance'],
 ['Crime', 'Drama', 'Mystery'],
 ['Adventure', 'Comedy', 'Romance'],
 ['Comedy', 'Crime', 'Drama'],
 ['Adventure', 'Drama', 'Thriller'],
 ['Biography', 'Crime', 'Drama'],
 ['Crime', 'Drama', 'Thriller'],
 ['Drama', 'History', 'Thriller'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Comedy'],
 ['Horror'],
 ['Action', 'Crime', 'Mystery'],
 ['Comedy', 'Romance'],
 ['Comedy'],
 ['Action', 'Drama', 'Thriller'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Drama', 'Mystery', 'Thriller'],
 ['Comedy', 'Drama', 'Romance'],
 ['Action', 'Fantasy', 'Horror'],
 ['Drama', 'Romance'],
 ['Biography', 'Drama'],
 ['Biography', 'Drama'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Drama', 'Mystery', 'Thriller'],
 ['Action', 'Horror', 'Sci-Fi'],
 ['Drama', 'Romance'],
 ['Biography', 'Drama'],
 ['Action', 'Adventure', 'Drama'],
 ['Adventure', 'Drama', 'Fantasy'],
 ['Drama', 'Family'],
 ['Comedy', 'Drama', 'Romance'],
 ['Drama', 'Romance', 'Sci-Fi'],
 ['Action', 'Adventure', 'Thriller'],
 ['Comedy', 'Romance'],
 ['Crime', 'Drama', 'Horror'],
 ['Comedy', 'Fantasy'],
 ['Action', 'Comedy', 'Crime'],
 ['Adventure', 'Drama', 'Romance'],
 ['Action', 'Crime', 'Drama'],
 ['Crime', 'Horror', 'Thriller'],
 ['Romance', 'Sci-Fi', 'Thriller'],
 ['Comedy', 'Drama', 'Romance'],
 ['Crime', 'Drama'],
 ['Crime', 'Drama', 'Mystery'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Animation', 'Fantasy'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Drama', 'Mystery', 'War'],
 ['Comedy', 'Romance'],
 ['Animation', 'Comedy', 'Family'],
 ['Comedy'],
 ['Horror', 'Mystery', 'Thriller'],
 ['Action', 'Adventure', 'Drama'],
 ['Comedy'],
 ['Drama'],
 ['Adventure', 'Biography', 'Drama'],
 ['Comedy'],
 ['Horror', 'Thriller'],
 ['Action', 'Drama', 'Family'],
 ['Comedy', 'Fantasy', 'Horror'],
 ['Comedy', 'Romance'],
 ['Drama', 'Mystery', 'Romance'],
 ['Action', 'Adventure', 'Comedy'],
 ['Thriller'],
 ['Comedy'],
 ['Adventure', 'Comedy', 'Sci-Fi'],
 ['Comedy', 'Drama', 'Fantasy'],
 ['Mystery', 'Thriller'],
 ['Comedy', 'Drama'],
 ['Adventure', 'Drama', 'Family'],
 ['Horror', 'Thriller'],
 ['Action', 'Drama', 'Romance'],
 ['Drama', 'Romance'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Comedy'],
 ['Action', 'Biography', 'Drama'],
 ['Drama', 'Mystery', 'Romance'],
 ['Adventure', 'Drama', 'Western'],
 ['Drama', 'Music', 'Romance'],
 ['Comedy', 'Romance', 'Western'],
 ['Thriller'],
 ['Comedy', 'Drama', 'Romance'],
 ['Horror', 'Thriller'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Crime', 'Drama', 'Mystery'],
 ['Horror', 'Mystery'],
 ['Comedy', 'Crime', 'Drama'],
 ['Action', 'Comedy', 'Romance'],
 ['Biography', 'Drama', 'History'],
 ['Adventure', 'Drama'],
 ['Drama', 'Thriller'],
 ['Drama'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Action', 'Biography', 'Drama'],
 ['Drama', 'Music'],
 ['Comedy', 'Drama'],
 ['Drama', 'Thriller', 'War'],
 ['Action', 'Mystery', 'Thriller'],
 ['Horror', 'Sci-Fi', 'Thriller'],
 ['Comedy', 'Drama', 'Romance'],
 ['Action', 'Sci-Fi'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Drama', 'Mystery', 'Romance'],
 ['Drama'],
 ['Action', 'Adventure', 'Thriller'],
 ['Action', 'Crime', 'Thriller'],
 ['Animation', 'Action', 'Adventure'],
 ['Drama', 'Fantasy', 'Mystery'],
 ['Drama', 'Sci-Fi'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Horror', 'Thriller'],
 ['Action', 'Thriller'],
 ['Comedy'],
 ['Biography', 'Drama'],
 ['Action', 'Mystery', 'Thriller'],
 ['Action', 'Mystery', 'Sci-Fi'],
 ['Crime', 'Drama', 'Thriller'],
 ['Comedy', 'Romance'],
 ['Comedy', 'Drama', 'Romance'],
 ['Biography', 'Drama', 'Thriller'],
 ['Drama'],
 ['Action', 'Adventure', 'Family'],
 ['Animation', 'Comedy', 'Family'],
 ['Action', 'Crime', 'Drama'],
 ['Comedy'],
 ['Comedy', 'Crime', 'Thriller'],
 ['Comedy', 'Romance'],
 ['Animation', 'Comedy', 'Drama'],
 ['Action', 'Crime', 'Thriller'],
 ['Comedy', 'Romance'],
 ['Adventure', 'Biography', 'Drama'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Crime', 'Drama', 'Mystery'],
 ['Action', 'Comedy', 'Sci-Fi'],
 ['Comedy', 'Fantasy', 'Horror'],
 ['Comedy', 'Crime'],
 ['Animation', 'Action', 'Adventure'],
 ['Action', 'Drama', 'Thriller'],
 ['Fantasy', 'Horror'],
 ['Crime', 'Drama', 'Thriller'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Comedy', 'Drama', 'Romance'],
 ['Biography', 'Drama', 'Romance'],
 ['Action', 'Drama', 'History'],
 ['Action', 'Adventure', 'Comedy'],
 ['Horror', 'Thriller'],
 ['Horror', 'Mystery', 'Thriller'],
 ['Comedy', 'Romance'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Crime', 'Drama', 'Mystery'],
 ['Crime', 'Drama', 'Mystery'],
 ['Adventure', 'Biography', 'Drama'],
 ['Horror', 'Mystery', 'Thriller'],
 ['Horror', 'Thriller'],
 ['Drama', 'Romance', 'War'],
 ['Adventure', 'Fantasy', 'Mystery'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Biography', 'Drama'],
 ['Drama', 'Thriller'],
 ['Horror', 'Thriller'],
 ['Drama', 'Horror', 'Thriller'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Action', 'Horror', 'Thriller'],
 ['Comedy'],
 ['Drama', 'Sport'],
 ['Comedy', 'Family'],
 ['Drama', 'Romance'],
 ['Action', 'Adventure', 'Comedy'],
 ['Comedy'],
 ['Mystery', 'Romance', 'Thriller'],
 ['Crime', 'Drama'],
 ['Action', 'Comedy'],
 ['Crime', 'Drama', 'Mystery'],
 ['Biography', 'Drama', 'Romance'],
 ['Comedy', 'Crime'],
 ['Drama', 'Thriller'],
 ['Drama'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Action', 'Thriller'],
 ['Drama', 'Thriller'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Crime', 'Drama', 'Mystery'],
 ['Thriller'],
 ['Biography', 'Drama', 'Sport'],
 ['Crime', 'Drama', 'Thriller'],
 ['Drama', 'Music'],
 ['Crime', 'Drama', 'Thriller'],
 ['Drama', 'Romance'],
 ['Animation', 'Action', 'Adventure'],
 ['Comedy', 'Drama'],
 ['Action', 'Adventure', 'Drama'],
 ['Biography', 'Crime', 'Drama'],
 ['Horror'],
 ['Biography', 'Drama', 'Mystery'],
 ['Drama', 'Romance'],
 ['Animation', 'Drama', 'Romance'],
 ['Comedy', 'Family'],
 ['Drama'],
 ['Mystery', 'Thriller'],
 ['Drama', 'Fantasy', 'Horror'],
 ['Drama', 'Romance'],
 ['Biography', 'Drama', 'History'],
 ['Comedy', 'Family'],
 ['Action', 'Adventure', 'Thriller'],
 ['Comedy', 'Drama'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Action', 'Thriller'],
 ['Drama', 'Romance'],
 ['Comedy', 'Drama', 'Romance'],
 ['Drama', 'Horror', 'Sci-Fi'],
 ['Comedy', 'Horror', 'Romance'],
 ['Drama'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Action', 'Adventure', 'Drama'],
 ['Biography', 'Comedy', 'Drama'],
 ['Drama', 'Mystery', 'Romance'],
 ['Animation', 'Adventure', 'Comedy'],
 ['Drama', 'Romance', 'Sci-Fi'],
 ['Drama'],
 ['Drama', 'Fantasy'],
 ['Drama', 'Romance'],
 ['Comedy', 'Horror', 'Thriller'],
 ['Comedy', 'Drama', 'Romance'],
 ['Crime', 'Drama'],
 ['Comedy', 'Romance'],
 ['Action', 'Drama', 'Family'],
 ['Comedy', 'Drama', 'Romance'],
 ['Action', 'Thriller', 'War'],
 ['Action', 'Comedy', 'Horror'],
 ['Biography', 'Drama', 'Sport'],
 ['Adventure', 'Comedy', 'Drama'],
 ['Comedy', 'Romance'],
 ['Comedy', 'Romance'],
 ['Comedy', 'Drama', 'Romance'],
 ['Action', 'Adventure', 'Crime'],
 ['Comedy', 'Romance'],
 ['Animation', 'Action', 'Adventure'],
 ['Action', 'Crime', 'Sci-Fi'],
 ['Drama'],
 ['Comedy', 'Drama', 'Romance'],
 ['Crime', 'Thriller'],
 ['Comedy', 'Horror', 'Sci-Fi'],
 ['Drama', 'Thriller'],
 ['Drama', 'Fantasy', 'Horror'],
 ['Thriller'],
 ['Adventure', 'Drama', 'Family'],
 ['Mystery', 'Sci-Fi', 'Thriller'],
 ['Biography', 'Crime', 'Drama'],
 ['Drama', 'Fantasy', 'Horror'],
 ['Action', 'Adventure', 'Thriller'],
 ['Crime', 'Drama', 'Horror'],
 ['Crime', 'Drama', 'Fantasy'],
 ['Adventure', 'Family', 'Fantasy'],
 ['Action', 'Adventure', 'Drama'],
 ['Action', 'Comedy', 'Horror'],
 ['Comedy', 'Drama', 'Family'],
 ['Action', 'Thriller'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Adventure', 'Drama', 'Fantasy'],
 ['Drama'],
 ['Drama'],
 ['Comedy'],
 ['Drama'],
 ['Comedy', 'Drama', 'Music'],
 ['Drama', 'Fantasy', 'Music'],
 ['Drama'],
 ['Thriller'],
 ['Comedy', 'Horror'],
 ['Action', 'Comedy', 'Sport'],
 ['Horror'],
 ['Comedy', 'Drama'],
 ['Action', 'Drama', 'Thriller'],
 ['Drama', 'Romance'],
 ['Horror', 'Mystery'],
 ['Adventure', 'Drama', 'Fantasy'],
 ['Thriller'],
 ['Comedy', 'Romance'],
 ['Action', 'Sci-Fi', 'Thriller'],
 ['Fantasy', 'Mystery', 'Thriller'],
 ['Biography', 'Drama'],
 ['Crime', 'Drama'],
 ['Action', 'Adventure', 'Sci-Fi'],
 ['Adventure'],
 ['Comedy', 'Drama'],
 ['Comedy', 'Drama'],
 ['Comedy', 'Drama', 'Romance'],
 ['Adventure', 'Comedy', 'Drama'],
 ['Action', 'Sci-Fi', 'Thriller'],
 ['Comedy', 'Romance'],
 ['Action', 'Fantasy', 'Horror'],
 ['Crime', 'Drama', 'Thriller'],
 ['Action', 'Drama', 'Thriller'],
 ['Crime', 'Drama', 'Mystery'],
 ['Crime', 'Drama', 'Mystery'],
 ['Drama', 'Sci-Fi', 'Thriller'],
 ['Biography', 'Drama', 'History'],
 ['Crime', 'Horror', 'Thriller'],
 ['Drama'],
 ['Drama', 'Mystery', 'Thriller'],
 ['Adventure', 'Biography'],
 ['Adventure', 'Biography', 'Crime'],
 ['Action', 'Horror', 'Thriller'],
 ['Action', 'Adventure', 'Western'],
 ['Horror', 'Thriller'],
 ['Drama', 'Mystery', 'Thriller'],
 ['Comedy', 'Drama', 'Musical'],
 ['Horror', 'Mystery'],
 ['Biography', 'Drama', 'Sport'],
 ['Comedy', 'Family', 'Romance'],
 ['Drama', 'Mystery', 'Thriller'],
 ['Comedy'],
 ['Drama'],
 ['Drama', 'Thriller'],
 ['Biography', 'Drama', 'Family'],
 ['Comedy', 'Drama', 'Family'],
 ['Drama', 'Fantasy', 'Musical'],
 ['Comedy'],
 ['Adventure', 'Family'],
 ['Adventure', 'Comedy', 'Fantasy'],
 ['Horror', 'Thriller'],
 ['Drama', 'Romance'],
 ['Horror'],
 ['Biography', 'Drama', 'History'],
 ['Action', 'Adventure', 'Fantasy'],
 ['Drama', 'Family', 'Music'],
 ['Comedy', 'Drama', 'Romance'],
 ['Action', 'Adventure', 'Horror'],
 ['Comedy'],
 ['Crime', 'Drama', 'Mystery'],
 ['Horror'],
 ['Drama', 'Music', 'Romance'],
 ['Adventure', 'Comedy'],
 ['Comedy', 'Family', 'Fantasy']]



genre_list=[j for i in class_list for j in i]

# 去重
genre=np.unique(genre_list)
genre



array(['Action', 'Adventure', 'Animation', 'Biography', 'Comedy', 'Crime',
       'Drama', 'Family', 'Fantasy', 'History', 'Horror', 'Music',
       'Musical', 'Mystery', 'Romance', 'Sci-Fi', 'Sport', 'Thriller',
       'War', 'Western'], dtype='<U9')



# 创建一个用于统计电影类别的空的dataframe

genre_type=pd.DataFrame(np.zeros((1000,len(genre)),dtype=np.int32), columns=genre)
genre_type.head()
ActionAdventureAnimationBiographyComedyCrimeDramaFamilyFantasyHistoryHorrorMusicMusicalMysteryRomanceSci-FiSportThrillerWarWestern
000000000000000000000
100000000000000000000
200000000000000000000
300000000000000000000
400000000000000000000
 for i in range(1000):
        genre_type.loc[i,class_list[i]]=1

genre_type.head()
ActionAdventureAnimationBiographyComedyCrimeDramaFamilyFantasyHistoryHorrorMusicMusicalMysteryRomanceSci-FiSportThrillerWarWestern
011000000000000010000
101000000000001010000
200000000001000000100
300101001000000000000
411000000100000000000
genre_type.sum(axis=0).sort_values(ascending=False). plot(kind="bar",figsize=(20,8),fontsize=30,colormap="cool")



<matplotlib.axes._subplots.AxesSubplot at 0x7f8cd01176a0>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值