<jupyter_start><jupyter_text>Data exploration summary: screen size This notebook explores how screen size relates to sales price.- Bigger laptops sell for more.- *Generally*, including size in the title and descirption is associated with higher sale price.- But there's some complication. Including size in title increases sales price when we look at the major sizes (13" and 15");- but we get strange results if the user listed 13.3" and 15.4"—an effect I'm still looking in to.<jupyter_code>import pandas as pd

laptopData = pd.read_csv("fulldataset.csv", encoding = 'ISO-8859-1')

#since we're visualizing data in connection with size, drop missing values for size. also, group 13.3" with 13", and 15.4" with 15".
laptopData = laptopData.dropna(subset=['size'])
laptopData.head()<jupyter_output><empty_output><jupyter_text>As we might expect, the larger the screen size, the higher the final selling price:<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

m, b = np.polyfit(laptopData["size"], laptopData["price"], 1)

fig=plt.figure()
ax=fig.add_axes([0,0,1,1])
ax.scatter(laptopData["size"], laptopData["price"], color='b')
ax.set_xlabel('Screen size')
ax.set_ylabel('Price')
ax.set_title('scatter plot')
plt.plot(laptopData["size"], m*laptopData["size"] + b)
plt.xlim(12.5, 16.5)
plt.ylim(0, 3000)
plt.show()<jupyter_output><empty_output><jupyter_text>It seems that including screen size in the title is associated with higher sales price across 13" and 15" screens, but with the complication that those reporting as 13.3"/15.4" are exceptional:<jupyter_code>import seaborn as sns
sns.set_theme(style="whitegrid")

ax = sns.pointplot(x="size_in_title", y="price", data=laptopData)
import seaborn as sns
sns.set_theme(style="whitegrid")

laptopData2 = laptopData[(laptopData['size'] == 13) | (laptopData['size'] == 13.3) | (laptopData['size'] == 15) | (laptopData['size'] == 15.4)]

ax = sns.pointplot(x="size", y="price", hue="size_in_title", dodge=True, data=laptopData2)<jupyter_output><empty_output><jupyter_text>As for those 16" laptops, there isn't enough data on cases where the seller left out the size from the title—there have only been three such cases!<jupyter_code>laptopData2 = laptopData[(laptopData['size'] == 16) & (laptopData['size_in_title'] == False)]
len(laptopData2)<jupyter_output><empty_output><jupyter_text>Including size in the *description* also yields an effect, in particular for 15":<jupyter_code>ax = sns.pointplot(x="size_in_description", y="price", data=laptopData)
laptopData2 = laptopData[(laptopData['size'] == 13) | (laptopData['size'] == 13.3) | (laptopData['size'] == 15) 
                    | (laptopData['size'] == 15.4)]

ax = sns.pointplot(x="size", y="price", hue="size_in_description", dodge=True, data=laptopData2)<jupyter_output><empty_output><jupyter_text>No effect for 16" screens:<jupyter_code>laptopData2 = laptopData[(laptopData['size'] == 16)]

ax = sns.pointplot(x="size", y="price", hue="size_in_description", dodge=True, data=laptopData2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14127243066884176, 'fraction_numerical': 0.02903752039151713, 'mean_word_length': 6.801526717557252, 'pattern_counts': {'":': 1, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '244086', 'license': 'MIT', 'n_tokens_mistral': 1143, 'n_tokens_neox': 1027, 'n_words': 282, 'path': 'data_exploration/size_exploration.ipynb', 'repo_name': 'jzymet/Uppraisal', 'size': '3065'}