import pandas as pd
from matplotlib import pyplot as plt
import numpy as np
file_path="C:/Users/ming/Desktop/DataAnalysis-master/day05/code/IMDB-Movie-Data.csv"
df=pd.read_csv(file_path)
print(df.head(1))
print(df.info())
runtime_data = df["Runtime (Minutes)"].values
max_runtime=runtime_data.max()
min_runtime=runtime_data.min()
print(max_runtime-min_runtime)
num_bin=(max_runtime-min_runtime)//5
plt.figure(figsize=(10,8),dpi=80)
plt.hist(runtime_data,num_bin)
plt.xticks(np.arange(min_runtime,max_runtime+5,5))
plt.show()
import pandas as pd
from matplotlib import pyplot as plt
import numpy as np
file_path="C:/Users/ming/Desktop/DataAnalysis-master/day05/code/IMDB-Movie-Data.csv"
df=pd.read_csv(file_path)
print(df.head(1))
print(df.info())
runtime_data = df["Rating"].values
max_runtime=runtime_data.max()
min_runtime=runtime_data.min()
print(max_runtime-min_runtime)
num_bin=(max_runtime-min_runtime)//0.1
num_bin = num_bin.astype('int')
plt.figure(figsize=(10,8),dpi=80)
plt.hist(runtime_data,num_bin)
plt.xticks(np.arange(min_runtime,max_runtime+0.1,0.1))
plt.show()
import pandas as pd
from matplotlib import pyplot as plt
import numpy as np
file_path="C:/Users/ming/Desktop/DataAnalysis-master/day05/code/IMDB-Movie-Data.csv"
df=pd.read_csv(file_path)
print(df.head(1))
print(df.info())
runtime_data = df["Rating"].values
max_runtime=runtime_data.max()
min_runtime=runtime_data.min()
print(max_runtime-min_runtime)
num_bin_list=[1.6+i*0.5 for i in range(12)]
plt.figure(figsize=(10,8),dpi=80)
plt.hist(runtime_data,num_bin_list)
plt.xticks(num_bin_list)
plt.show()