How I Buy and Sell Apple Using Data Analysis

Idea



For me, Apple technology has been an unavailable product for a long time. However, a few years ago, I discovered a couple of ideas that allow me to buy Apple equipment for very cheap, for example, a new MacBook cost me only 20,000 rubles , AirPods generally 1,800 rubles , the latest iPhone is the most expensive from the list: 30,000 rubles . I always buy exclusively new equipment, but I use several rules for both buying and selling.... Selling is a very important part of the process, equipment must be sold on time; before, I could use the equipment for 4 years and later just leave my old iPhone - this is not rational from an economic point of view. The idea behind my method is simple: to minimize the difference between the buy and sell prices.



In this article, I will show how I came to the optimal date for buying and selling, using the statistics of prices for equipment from previous years and parsing sites with used equipment. Note that this process can be done for any technique, I will consider Apple.



Purchase



Buying is the easiest part. I have a very simple algorithm: I go to Yandex Market and choose the lowest price, a maximum of a month after the release of a new device . All. Of course, this is equipment from Gorbushka, which was brought from Europe or America, but the only thing I lose in comparison with PCT equipment is the second year of warranty, for me personally -20% is much more profitable than a year of additional warranty. (While writing the article, one AirPods Pro earphone was replaced for free due to the fact that it cracked) . This year I bought myself a MacBook Pro for 80 thousand and AirPods Pro for 16 thousand, (I sold the previous MacBook for 40 and bought for 60, and I generally sold AirPods for 7 (separately true))), buying for 8800)... These prices even correlate with prices in the American Apple store without taxes. It is worth noting that it is imperative to check the equipment before buying: look at the serial number, its coincidence on the phone and on the box, and various other precautions when buying equipment in similar markets.



Sale



I would like to note that the purchase of equipment is an Import and the funds are β€œsaved” in dollars. The idea is that when you buy a MacBook for 80,000 rubles, you actually buy it for $ 1200 and can sell it on foreign platforms for dollars, that is, various fluctuations in the ruble exchange rate for my model will be insignificant. Nevertheless, I sold all the equipment on Avito, since the exchange rate for the last 4-5 years has been stable: $ 1 = 65 rubles.



On sale, the most important thing is to choose the right time: this is the task of this article, to calculate the most profitable time for buying and selling a device.



Device selection



Okay, I'll take a look at my model on the example of an iPad I'm planning to buy. By the way, about the iPhone - this is one of the most disadvantageous gadgets - it costs like a MacBook, while it does not have the functionality necessary for a working machine, and its cost, for example, my XS, fell by 50% over the year, summing up - it is extremely unprofitable to buy an iPhone.



Parsing Avito



I didn't find an API from Avito, so I had to use Python and Selenium. Not the most stable solution, but it seems to work. To begin with, I will try to load data on the request "iPad 11 PRO 64GB" and see what is there with the prices and analyze them. My Selenium code looks like this:



Selenium code
import csv
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.options import Options

search = 'iPad Pro 11 64GB'
page = 1

with open('venv/{}data.csv'.format(search), 'w') as new_file:
    # csv
    fieldnames = ['Search key', 'Page', 'Price, RUB', 'Subway nearby']

    csv_writer = csv.DictWriter(new_file, fieldnames=fieldnames, delimiter=',')

    csv_writer.writeheader()

    # prepare for parsing
    chrome_options = Options()
    chrome_options.add_argument("--headless")  # we will not open selenium browser just not to slow your pc =D
    website = 'https://www.avito.ru/moskva?q=' + str(search) + '&p=' + str(page)
    driver = webdriver.Chrome(ChromeDriverManager().install(), options=chrome_options)
    driver.implicitly_wait(10)
    driver.get(website)

    # shit to find
    name = "h3[class='snippet-title']"
    url = "a[class='snippet-link']"
    price = "span[data-marker='item-price']"
    address = "div[class='item-address']"

    # itemlines
    try:
        driver.find_element_by_css_selector("div[class='item__line']")  # check if selector exists
        itemlines = driver.find_elements_by_css_selector("div[class='item__line']")
        # code to execute
        for el in itemlines:
            try:
                el.find_element_by_css_selector(address)
                new_file.write(str(el.find_element_by_css_selector(name).text).replace(',', '') + ',' +
                               el.find_element_by_css_selector(url).get_attribute('href') + ',' +
                               el.find_element_by_css_selector(price).text + ',' +
                               str(el.find_element_by_css_selector(address).text).replace(',', '.'))
                new_file.write('\n')
            except:
                new_file.write(str(el.find_element_by_css_selector(name).text).replace(',', '') + ',' +
                               el.find_element_by_css_selector(url).get_attribute('href') + ',' +
                               el.find_element_by_css_selector(price).text + ',' +
                               'None')
                new_file.write('\n')
        print('Data saved to CSV | {}.csv'.format(search))
    except:
        print('There are no items due to your request')
    # global quit and log
    print('Browser closed')
    driver.quit()


I'll see what ended up in the plate:



Nameplate


Quite a lot of emissions - it is obvious that an iPad Pro with a game of Fortnite would never have cost 120,000 without an information feed , just like an iPad with a "locked motherboard" for 4500. In short, we need to clean up the date and remove all unnecessary so that it can be analyzed ...



Data analysis



Now there is a fairly trivial analysis - I open jupyter notebook and import pandas - I start working with data. Okay, the first thing I want to do is remove the ruble icon, which remained in the plate during parsing.



data['Price, RUB'] = data['Price, RUB'].str.replace("β‚½", "")


Now I would like the "Price, RUB" column to be in int32 format.



data['Price, RUB'] = data['Price, RUB'].str.replace(' ', '')
data['Price, RUB'] = data['Price, RUB'].astype('int32')


I leave only those positions that are more expensive than 30,000 and cheaper than 68,000 (the price of the new iPad Pro).



data = data[data["Price, RUB"] > 30000]
data = data[data["Price, RUB"] < 68000]


Now you can just calculate the average.



data["Price, RUB"].mean()


The average price for a used iPad Pro 11 64 GB = 48 382 rubles



In general, a fairly logical value, the only thing that confused me was the large standard deviation. Now let's look at the 2017 iPad Pro. (before that, I was only looking for the 2018 iPad, indicating the diagonal - 11).



My search is:



search = 'iPad PRO 10.5 2017 64Gb WIFI'


The average price for the iPad Pro 2017 10.5 WIFI 64 GB = 25888 rubles It is



very easy to calculate the price of use.



2 years of using iPad PRO 2018 = (62000 - 48382) / 2 = 13675 rubles (6837.5 per year)

3 years of using iPad PRO 2017 = 36112 rubles (12037 per year)



At the beginning of the article I wrote the price of my devices, bearing in mind of course the difference between them buying and selling, as you can see, you can buy an iPad Pro and use it for two years for only 13,675 rubles. This is exactly how it is worth buying equipment and keeping in mind the difference between the purchase price and the expected sale price.



The difference in prices of various iPads per year is almost two times, while the greatest decrease in cost occurs immediately after purchase and inn-th year , where n is a number, depending on the release of the new generation, battery life, development of new technologies, support for the new OC, and so on. What conclusion can be drawn by analyzing data about the iPad? It is profitable to sell an iPad after 2 years and buy a new one, so you can minimize the cost of using it.



Why is it necessary to sell after 2 years



Each Apple device has a built-in Li-ion battery that can last 2-3 years, depending on use. After the expiration of the time, the device starts to work incorrectly: slow down, discharge quickly, etc. By the way, in America Apple sells the iPhone on a contract for exactly 24 months, most likely due to the battery.



Why Apple Should Sell Before Presentation



It is still more logical here: new presentation = new devices and therefore the old ones decrease in price. To make it clearer - a chart from bankmycell.







conclusions



  1. When buying, you need to consider the difference between the purchase price and the expected selling price.
  2. It is worth looking at the device's historical selling prices.
  3. Analysis of the data using the iPad example shows that it is more profitable to sell it after 2 years.
  4. Because of the lithium-ion batteries, it is best to sell the device after 2, maximum 3 years.
  5. Apple rationally sell before the presentation - it will be the most profitable.
  6. In my model, such important factors as: the presence of a new design, support for the OS and new technologies (5G for example), and other factors were not taken into account.


Sources



[1]. Lithium-Ion Battery Maintenance Guidelines. URL: www.newark.com/pdfs/techarticles/tektronix/LIBMG.pdf . Accessed 08/26/2020

[2]. CELL PHONE DEPRECIATION & PRICE DROPS. URL: www.bankmycell.com/blog/phone-depreciation . Accessed 08/26/2020



All Articles