# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import locale
locale.setlocale(locale.LC_ALL, 'Persian')
# %config IPCompleter.greedy=True

import pandas as pd
df= pd.read_csv("resources/divar_posts_dataset.csv")

phone = df.loc[(df['cat1']=="electronic-devices") & (df['cat2']=="mobile-tablet") &(df['cat3']=="mobile-phones")]
brands = phone.brand.unique()

# +
#phone.brand.to_csv("brands.csv", sep=',', encoding="UTF-8")
# -

with open('resources/brands.csv', 'w', encoding="UTF-8") as f:
    f.write("%s\n" % "brands")
    for item in brands:
        f.write("%s\n" % item)





StarcoderdataJupyterScriptsDedupFiltered