Answer the question
In order to leave comments, you need to log in
Python + Yandex Direct API: how to get LocationOfPresenceName correctly?
I have a Python script that uploads Yandex.Direct data via API to Google Big Query. Among other things, I upload LocationOfPresenceName or TargetingLocationName, but in the upload I get values like pїЅpїЅpїЅpїЅpїЅpїS. How to get values in normal encoding? I am attaching the script just in case, with a link, since there is not enough space for the text here.
Script
Answer the question
In order to leave comments, you need to log in
If you're interested, I figured it out. The problem was in the get_ads_stat function. There is a line there:
data = pd.read_csv(TSV_PATH + name + '.txt', sep='\t', encoding='cp1251'
) intermediate saving to a text file goes exactly in it, and by default it apparently reads as utf8. After that, all values are displayed correctly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question