{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Step 1 - Prepare Data\n", "\n", "Data cleaning." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\makayser\\AppData\\Roaming\\Python\\Python36\\site-packages\\requests\\__init__.py:91: RequestsDependencyWarning: urllib3 (1.25.7) or chardet (3.0.4) doesn't match a supported version!\n", " RequestsDependencyWarning)\n" ] } ], "source": [ "# Custom Functions\n", "import sys\n", "sys.path.append('../src')\n", "import data as dt\n", "import prepare as pr\n", "import helper as he" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Load Data" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "dt_task = dt.Data()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "data = dt_task.load('fn_clean')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "fn_data = he.get_config()['path']['sample_dir'] + 'data.txt'" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "data = pd.read_csv(fn_data, sep='\\t', encoding='utf-8')" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['id', 'views', 'appliesTo', 'url', 'language', 'question_title',\n", " 'question_author', 'question_createdAt', 'question_text',\n", " 'question_upvotes', 'answer_markedAsAnswer', 'answer_createdAt',\n", " 'answer_text', 'answer_upvotes'],\n", " dtype='object')" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data.columns" ] }, { "cell_type": "code", "execution_count": 135, "metadata": {}, "outputs": [], "source": [ "data = data[data.answer_markedAsAnswer == True].reset_index(drop=True).copy()" ] }, { "cell_type": "code", "execution_count": 139, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'{\"id\":{\"0\":1,\"1\":4,\"2\":5,\"3\":6,\"4\":7},\"views\":{\"0\":58771,\"1\":119,\"2\":26,\"3\":9041,\"4\":257},\"appliesTo\":{\"0\":\"msoffice,Outlook,Windows 8,Office 365 Home\",\"1\":\"bing,Bing Ads,Bing Ads customers,Universal Event Tracking, conversions, reporting\",\"2\":\"bing,Other,Developers and webmasters\",\"3\":\"bing,Maps,Sharing and social search results,Bing.com for PC\\\\/Mac browsers\",\"4\":\"bing,Other,Bing users and consumers\"},\"url\":{\"0\":\"http:\\\\/\\\\/answers.microsoft.com\\\\/en-us\\\\/office\\\\/forum\\\\/office_365hp-outlook\\\\/unable-to-delete-emails-message-the-operation\\\\/feb1c2f0-430c-4622-a1ce-790474f44afc\",\"1\":\"https:\\\\/\\\\/answers.microsoft.com\\\\/en-us\\\\/bing\\\\/forum\\\\/all\\\\/api-webfault-deserialize-parameter-in-python\\\\/eb2d6f02-c93a-4f95-b08d-60411b67b852\",\"2\":\"https:\\\\/\\\\/answers.microsoft.com\\\\/en-us\\\\/bing\\\\/forum\\\\/bing_ads-bing_adscustomers\\\\/bing-ads-api-invalidlocationid-error-for-italy-and\\\\/80e46c5b-6f3e-48c2-bac6-a5e0e8b816fe\",\"3\":\"https:\\\\/\\\\/answers.microsoft.com\\\\/en-us\\\\/bing\\\\/forum\\\\/bing_maps-bing_sharing\\\\/how-do-i-import-places-into-bing-maps\\\\/78d37c4d-f3cc-4432-acaa-ed223c6cdc0f\",\"4\":\"https:\\\\/\\\\/answers.microsoft.com\\\\/en-us\\\\/bing\\\\/forum\\\\/bing_other-bing_users\\\\/change-my-region-in-billing-info\\\\/3f2c856b-ae9f-47ff-8bfe-fc8f8275016f\"},\"language\":{\"0\":\"en-us\",\"1\":\"en-us\",\"2\":\"en-us\",\"3\":\"en-us\",\"4\":\"en-us\"},\"question_title\":{\"0\":\"Unable to delete emails - message: The operation cannot be performed because the object has been deleted\",\"1\":\"API WebFault deserialize parameter in Python\",\"2\":\"Bing ads api InvalidLocationId error for Italy and Japan.\",\"3\":\"How do I import places into Bing Maps?\",\"4\":\"Change my region in billing info?\"},\"question_author\":{\"0\":\"ChristopherStringer\",\"1\":\"Joe Heffer\",\"2\":\"ChetanSingh1\",\"3\":\"NeilBenson\",\"4\":\"ePLayar\"},\"question_createdAt\":{\"0\":\"2013-11-21T20:45:35\",\"1\":\"2017-11-07T17:09:27\",\"2\":\"2018-01-02T18:14:01\",\"3\":\"2014-07-14T19:16:09\",\"4\":\"2015-12-05T13:47:50\"},\"question_text\":{\"0\":\"

I had problems updating from Windows 8 to Windows 8.1. This was resolved today by MS on a remote session but as my Microsoft\\\\u00a0 account was corrupt they had to close it and reopen one using same email address. Everything has been reinstated including OFFICE 365, however if I try to delete an email I get a message \\\\\"The operation cannot be performed because the object has been deleted\\\\\".<\\\\/font><\\\\/span><\\\\/p>

<\\\\/font><\\\\/span><\\\\/p>

The other problem is sending emails. I thought they were getting stuck in the Outbox until I received a reply to one. So it appears they are being sent but staying in the Outbox rather than dropping into the sent folder. Not sure which problem is the most serious but really cannot live with either. Support is closed, so wonder if anyone has any ideas what I could try.<\\\\/font><\\\\/span><\\\\/p>\",\"1\":\"

Hi all,<\\\\/p>

<\\\\/p>

I have some working Python code (I can request and download reports) which I\\'m trying to port into a Django application (which also uses the Google Adwords API for Python.) I\\'m using Python 3.5.2 in both cases.<\\\\/p>

<\\\\/p>

I\\'m getting the following errors:<\\\\/p>

<\\\\/p>

<s:Envelope xmlns:s=\\\\\"http:\\\\/\\\\/schemas.xmlsoap.org\\\\/soap\\\\/envelope\\\\/\\\\\">\\\\u00a0 \\\\u00a0 <s:Body>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <s:Fault>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <faultcode xmlns:a=\\\\\"http:\\\\/\\\\/schemas.microsoft.com\\\\/net\\\\/2005\\\\/12\\\\/windowscommunicationfoundation\\\\/dispatcher\\\\\">a:DeserializationFailed<\\\\/faultcode>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <faultstring xml:lang=\\\\\"en-US\\\\\">The formatter threw an exception while trying to deserialize the message:\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 There was an error while trying to deserialize parameter https:\\\\/\\\\/bingads.microsoft.com\\\\/Reporting\\\\/v11:ReportRequest.\\\\u00a0\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 The InnerException message was \\\\\\\\\\'There was an error deserializing the object of type Microsoft.AdCenter.Advertiser.Reporting.Api.DataContracts.Request.ReportRequest.\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 The value \\\\\\\\\\'\\\\\\\\\\' cannot be parsed as the type \\\\\\\\\\'Int32\\\\\\\\\\'.\\\\\\\\\\'.\\\\u00a0 Please see InnerException for more details.<\\\\/faultstring>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <\\\\/s:Fault>\\\\u00a0 \\\\u00a0 <\\\\/s:Body><\\\\/s:Envelope>\\'<\\\\/p>

<\\\\/p>

from this SOAP request:<\\\\/p>

<\\\\/p>

<?xml version=\\\\\"1.0\\\\\" encoding=\\\\\"UTF-8\\\\\"?><\\\\/p>

<SOAP-ENV:Envelope xmlns:tns=\\\\\"https:\\\\/\\\\/bingads.microsoft.com\\\\/Reporting\\\\/v11\\\\\" xmlns:xsi=\\\\\"http:\\\\/\\\\/www.w3.org\\\\/2001\\\\/XMLSchema-instance\\\\\" xmlns:ns0=\\\\\"https:\\\\/\\\\/bingads.microsoft.com\\\\/Reporting\\\\/v11\\\\\" xmlns:SOAP-ENV=\\\\\"http:\\\\/\\\\/schemas.xmlsoap.org\\\\/soap\\\\/envelope\\\\/\\\\\" xmlns:ns1=\\\\\"http:\\\\/\\\\/schemas.xmlsoap.org\\\\/soap\\\\/envelope\\\\/\\\\\"><\\\\/span><\\\\/p>\\\\u00a0 \\\\u00a0 <SOAP-ENV:Header>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <tns:CustomerAccountId>********<\\\\/tns:CustomerAccountId>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <tns:CustomerId>*********<\\\\/tns:CustomerId>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <tns:DeveloperToken>BBD37VB98<\\\\/tns:DeveloperToken>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <tns:Password>********<\\\\/tns:Password>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <tns:UserName>joe_heffer_sbx<\\\\/tns:UserName>\\\\u00a0 \\\\u00a0 <\\\\/SOAP-ENV:Header>\\\\u00a0 \\\\u00a0 <ns1:Body>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:SubmitGenerateReportRequest>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:ReportRequest xsi:type=\\\\\"ns0:KeywordPerformanceReportRequest\\\\\">\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:ExcludeColumnHeaders>false<\\\\/ns0:ExcludeColumnHeaders>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:ExcludeReportFooter>true<\\\\/ns0:ExcludeReportFooter>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:ExcludeReportHeader>true<\\\\/ns0:ExcludeReportHeader>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Format>Csv<\\\\/ns0:Format>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Language>English<\\\\/ns0:Language>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:ReportName>Bing Report<\\\\/ns0:ReportName>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:ReturnOnlyCompleteData>false<\\\\/ns0:ReturnOnlyCompleteData>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Aggregation>Daily<\\\\/ns0:Aggregation>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Columns>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:KeywordPerformanceReportColumn>TimePeriod<\\\\/ns0:KeywordPerformanceReportColumn>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:KeywordPerformanceReportColumn>Spend<\\\\/ns0:KeywordPerformanceReportColumn>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <\\\\/ns0:Columns>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Filter>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:AdRelevance\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:ExpectedCtr\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Keywords\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:LandingPageExperience\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:LanguageCode\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:QualityScore\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <\\\\/ns0:Filter>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Scope\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Sort\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Time>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:CustomDateRangeEnd>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Day\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Month\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Year\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <\\\\/ns0:CustomDateRangeEnd>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:CustomDateRangeStart>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Day\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Month\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:Year\\\\/>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <\\\\/ns0:CustomDateRangeStart>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <ns0:PredefinedTime>ThisYear<\\\\/ns0:PredefinedTime>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <\\\\/ns0:Time>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <\\\\/ns0:ReportRequest>\\\\u00a0 \\\\u00a0 \\\\u00a0 \\\\u00a0 <\\\\/ns0:SubmitGenerateReportRequest>\\\\u00a0 \\\\u00a0 <\\\\/ns1:Body><\\\\/SOAP-ENV:Envelope>

<\\\\/p>\",\"2\":\"

Hi,\\\\u00a0<\\\\/p>

I am using Bing Ads PHP API and its working very good for USA, UK and Canada but for Italy and japan its showing error like\\\\u00a0<\\\\/p>

<\\\\/p>

for Italy\\\\u00a0<\\\\/p>

<\\\\/p>

<s:Envelope xmlns:s=\\\\\"http:\\\\/\\\\/schemas.xmlsoap.org\\\\/soap\\\\/envelope\\\\/\\\\\"><s:Body><s:Fault><faultcode>s:Server<\\\\/faultcode><faultstring xml:lang=\\\\\"en-US\\\\\">Invalid client data. Check the SOAP fault details for more information<\\\\/faultstring><detail><ApiFaultDetail xmlns=\\\\\"Microsoft.Advertiser.AdInsight.Api.Service.V11\\\\\" xmlns:i=\\\\\"http:\\\\/\\\\/www.w3.org\\\\/2001\\\\/XMLSchema-instance\\\\\"><TrackingId xmlns=\\\\\"https:\\\\/\\\\/adapi.microsoft.com\\\\\">0caff7d6-ad89-477e-963b-3dc8950bf12e<\\\\/TrackingId><BatchErrors xmlns:a=\\\\\"https:\\\\/\\\\/bingads.microsoft.com\\\\/AdInsight\\\\/v11\\\\\"\\\\/><OperationErrors xmlns:a=\\\\\"https:\\\\/\\\\/bingads.microsoft.com\\\\/AdInsight\\\\/v11\\\\\"><a:OperationError><a:Code>622<\\\\/a:Code><a:Details>LocationId: 93 is not supported. <\\\\/a:Details><a:ErrorCode>InvalidLocationId<\\\\/a:ErrorCode><a:Message>The location id is invalid.<\\\\/a:Message><\\\\/a:OperationError><\\\\/OperationErrors><\\\\/ApiFaultDetail><\\\\/detail><\\\\/s:Fault><\\\\/s:Body><\\\\/s:Envelope><\\\\/span><\\\\/p>

<\\\\/p>

The operation failed with the following faults:<\\\\/span><\\\\/p>

OperationError<\\\\/span><\\\\/p>

Code: 622<\\\\/span><\\\\/p>

Error Code: InvalidLocationId<\\\\/span><\\\\/p>

Message: The location id is invalid.<\\\\/span><\\\\/p>

<\\\\/p>

But in Geolocation file provided by bing have 93 as location ID. and i getting same error for\\\\u00a0 Japan for location Id 96.<\\\\/span><\\\\/p>

<\\\\/p>

Please help<\\\\/span><\\\\/p>

thanks<\\\\/span><\\\\/p>

<\\\\/p>

<\\\\/p>\",\"3\":\"

I have created a list of places in Google Maps and exported them as a KML file. Bing Maps also has an export option and also claims to have an import option too (http:\\\\/\\\\/onlinehelp.microsoft.com\\\\/en-us\\\\/bing\\\\/ff808584.aspx). But I can\\'t find the import feature anywhere in the Bing Maps user interface.<\\\\/p>

<\\\\/p>

Before I go too far saving places in either Bing Maps or Google Maps, I\\'d like to ensure I can exchange my saved places between them.\\\\u00a0<\\\\/p>

<\\\\/p>

Can anyone help?<\\\\/p>\",\"4\":\"

Hello,<\\\\/p>

I want to change my region in billing info but I can\\'t<\\\\/p>

in this link : https:\\\\/\\\\/commerce.microsoft.com\\\\/PaymentHub\\\\/Profile?lang=en-us<\\\\/p>

I can change everything except for country\\\\/region, any tips? thanks<\\\\/p>\"},\"question_upvotes\":{\"0\":387,\"1\":1,\"2\":0,\"3\":56,\"4\":10},\"answer_markedAsAnswer\":{\"0\":true,\"1\":true,\"2\":true,\"3\":true,\"4\":true},\"answer_createdAt\":{\"0\":\"November 26, 2013\",\"1\":\"November 7, 2017\",\"2\":\"January 2, 2018\",\"3\":\"July 15, 2014\",\"4\":\"December 9, 2015\"},\"answer_text\":{\"0\":\" This fix will most likely solve your problems, simply do this\\\\u00a0

<\\\\/div>

FILE - Account Settings - Account Settings - Change - More Settings - Advanced<\\\\/span><\\\\/p>

Where it says Folders - Root folder path:<\\\\/p>

Then enter the word: \\\\u00a0 \\\\u00a0inbox<\\\\/p>

<\\\\/p>

I got this info from this forum post here and it worked for me \\\\u00a0http:\\\\/\\\\/social.technet.microsoft.com\\\\/Forums\\\\/office\\\\/en-US\\\\/e5cf9882-82e9-4710-832f-186c38941558\\\\/imap-problem-with-outlook-2013-since-actual-patchday?forum=outlook<\\\\/a>\\\\u00a0<\\\\/p><\\\\/div><\\\\/div>\",\"1\":\"

Hi Joe,<\\\\/p>

<\\\\/p>

Thank you for your request!<\\\\/span> <\\\\/span><\\\\/p>

<\\\\/p>

For the best answers on Bing Ads API we do recommend that you visit our developers forum atBing Ads API Forum<\\\\/span><\\\\/a>\\\\u00a0In that forum you will find many developers who work with our API everyday and will be better equipped to answer your question.<\\\\/span><\\\\/p>

<\\\\/p>

If you are unable to find the answer, here is the link to instructions for contacting the API support channel directlyEngaging Support<\\\\/span><\\\\/a><\\\\/span><\\\\/p>

<\\\\/p>

We hope this helps!<\\\\/p>

<\\\\/p>

Thank you,<\\\\/p>

<\\\\/p>\",\"2\":\"

Hi ChetanSingh1,<\\\\/p>

<\\\\/p>

Thank you for reaching out to us! <\\\\/span>For the best response to your question, please post it in theBing Ads API Forum<\\\\/span><\\\\/a> where you will find many developers who will be able to help you with this issue.<\\\\/span><\\\\/p>

\\\\u00a0<\\\\/span><\\\\/p>

If you are unable to find the answer, here is the link to instructions for contacting the API support channel directly:\\\\u00a0Engaging Support<\\\\/span><\\\\/a>.<\\\\/span><\\\\/p>

\\\\u00a0<\\\\/span><\\\\/p>

Sincerely,<\\\\/span><\\\\/p>

<\\\\/p>\",\"3\":\"

" ], "text/plain": [ " id views appliesTo \\\n", "0 1 58771 msoffice,Outlook,Windows 8,Office 365 Home \n", "1 2 557 band,Microsoft Band,Microsoft Health app \n", "2 3 78 bing,Bing Ads,Bing Ads customers,Account login... \n", "3 4 119 bing,Bing Ads,Bing Ads customers,Universal Eve... \n", "4 6 9041 bing,Maps,Sharing and social search results,Bi... \n", "\n", " url language \\\n", "0 http://answers.microsoft.com/en-us/office/foru... en-us \n", "1 https://answers.microsoft.com/en-us/band/forum... en-us \n", "2 https://answers.microsoft.com/en-us/bing/forum... en-us \n", "3 https://answers.microsoft.com/en-us/bing/forum... en-us \n", "4 https://answers.microsoft.com/en-us/bing/forum... en-us \n", "\n", " question_title question_author \\\n", "0 Unable to delete emails - message: The operati... ChristopherStringer \n", "1 MS Band: An error occurred! on Dashboard maciejkoplin \n", "2 AddClientLinks API call fails with internal er... JonOler \n", "3 API WebFault deserialize parameter in Python Joe Heffer \n", "4 How do I import places into Bing Maps? NeilBenson \n", "\n", " question_createdAt question_text \\\n", "0 2013-11-21T20:45:35

I had problems updating from Windows 8 to W... \n", "1 2017-08-05T16:27:22

I have a strange problem with my Dashboard ... \n", "2 2017-06-01T06:57:23

I am attempting to ... \n", "3 2017-11-07T17:09:27

Hi all,

I have some working Py... \n", "4 2014-07-14T19:16:09

I have created a list of places in Google M... \n", "\n", " question_upvotes answer_markedAsAnswer answer_createdAt \\\n", "0 387 True November 26, 2013 \n", "1 48 False August 5, 2017 \n", "2 1 False June 1, 2017 \n", "3 1 True November 7, 2017 \n", "4 56 True July 15, 2014 \n", "\n", " answer_text answer_upvotes \\\n", "0 This fix will most likely solve your problems... 324 \n", "1

Exactly the same issue both on my phone and... 0 \n", "2

Hi Jon,

Your issue is more com... 0 \n", "3

Hi Joe,

\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;36m4\u001b[0m \u001b[1;33m:\u001b[0m \u001b[1;34m'qa'\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m }\n\u001b[1;32m----> 7\u001b[1;33m \u001b[0mtask_type_lookup\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[1;31mKeyError\u001b[0m: 0" ] } ], "source": [ "task_type_lookup = {\n", " 1 : 'classification',\n", " 2 : 'classification',\n", " 3 : 'ner',\n", " 4 : 'qa' \n", " }\n", "task_type_lookup[0]" ] }, { "cell_type": "code", "execution_count": 129, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'classification'" ] }, "execution_count": 129, "metadata": {}, "output_type": "execute_result" } ], "source": [ "task_type_lookup[1]" ] }, { "cell_type": "code", "execution_count": 115, "metadata": {}, "outputs": [ { "data": { "text/html": [ "

\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idviewsappliesTourllanguagequestion_titlequestion_authorquestion_createdAtquestion_textquestion_upvotesanswer_markedAsAnsweranswer_createdAtanswer_textanswer_upvotescatsubcattext
0158771msoffice,Outlook,Windows 8,Office 365 Homehttp://answers.microsoft.com/en-us/office/foru...en-usUnable to delete emails - message: The operati...ChristopherStringer2013-11-21T20:45:35<p>I had problems updating from Windows 8 to W...387TrueNovember 26, 2013This fix will most likely solve your problems...324Office 365 HomemsofficeUnable to delete emails - message: The operati...
2431404ie,Internet Explorer 11,Windows 10https://answers.microsoft.com/en-us/ie/forum/a...en-usDoes IE11 Support HTML 4.01 (11.0.10240.16384)themanindbox2018-04-26T19:36:06<p>Does IE11 on Windows 10 natively support HT...3FalseApril 26, 2018<p>Hi,</p><p></p><p>Tools&gt;ActiveX filtering...4Windows 10ieDoes IE11 Support HTML PTI ( PTI .102 PTI 384)
536231609ie,Internet Explorer 10,Windows 7https://answers.microsoft.com/en-us/ie/forum/i...en-usEnabling cookies in Internet Explorer 10Aaron Jacob2013-08-16T17:21:45Hi. I have Internet Explorer 10 on Windows 7....423TrueAugust 16, 2013<p>Go back to Internet options/ Security secti...82Windows 7ieEnabling cookies in Internet Explorer 10
546366795ie,Internet Explorer 10,Windows 7https://answers.microsoft.com/en-us/ie/forum/i...en-usHow do I delete cookies and cache in IE 10 Win...jprewitt2013-04-19T16:18:09<p>I have several users asking how can they de...207TrueApril 19, 2013<p>1. Click on the Tools \"cog\" in the top righ...24Windows 7ieHow do I delete cookies and cache in IE PNS Wi...
58673202ie,Internet Explorer 10,Windows 7https://answers.microsoft.com/en-us/ie/forum/i...en-usMultiple error messages on my IE 10. I have W...Lois Lannin2013-04-07T15:19:38<p>I am receiving multiple error messages on a...7TrueApril 8, 2013<p>Hi,</p><p> </p><p>Based on the description,...3Windows 7ieMultiple error messages on my IE 10. I have W...
\n", "
" ], "text/plain": [ " id views appliesTo \\\n", "0 1 58771 msoffice,Outlook,Windows 8,Office 365 Home \n", "24 31 404 ie,Internet Explorer 11,Windows 10 \n", "53 62 31609 ie,Internet Explorer 10,Windows 7 \n", "54 63 66795 ie,Internet Explorer 10,Windows 7 \n", "58 67 3202 ie,Internet Explorer 10,Windows 7 \n", "\n", " url language \\\n", "0 http://answers.microsoft.com/en-us/office/foru... en-us \n", "24 https://answers.microsoft.com/en-us/ie/forum/a... en-us \n", "53 https://answers.microsoft.com/en-us/ie/forum/i... en-us \n", "54 https://answers.microsoft.com/en-us/ie/forum/i... en-us \n", "58 https://answers.microsoft.com/en-us/ie/forum/i... en-us \n", "\n", " question_title question_author \\\n", "0 Unable to delete emails - message: The operati... ChristopherStringer \n", "24 Does IE11 Support HTML 4.01 (11.0.10240.16384) themanindbox \n", "53 Enabling cookies in Internet Explorer 10 Aaron Jacob \n", "54 How do I delete cookies and cache in IE 10 Win... jprewitt \n", "58 Multiple error messages on my IE 10. I have W... Lois Lannin \n", "\n", " question_createdAt question_text \\\n", "0 2013-11-21T20:45:35

I had problems updating from Windows 8 to W... \n", "24 2018-04-26T19:36:06

Does IE11 on Windows 10 natively support HT... \n", "53 2013-08-16T17:21:45 Hi. I have Internet Explorer 10 on Windows 7.... \n", "54 2013-04-19T16:18:09

I have several users asking how can they de... \n", "58 2013-04-07T15:19:38

I am receiving multiple error messages on a... \n", "\n", " question_upvotes answer_markedAsAnswer answer_createdAt \\\n", "0 387 True November 26, 2013 \n", "24 3 False April 26, 2018 \n", "53 423 True August 16, 2013 \n", "54 207 True April 19, 2013 \n", "58 7 True April 8, 2013 \n", "\n", " answer_text answer_upvotes \\\n", "0 This fix will most likely solve your problems... 324 \n", "24

Hi,

Tools>ActiveX filtering... 4 \n", "53

Go back to Internet options/ Security secti... 82 \n", "54

1. Click on the Tools \"cog\" in the top righ... 24 \n", "58

Hi,

 

Based on the description,... 3 \n", "\n", " cat subcat \\\n", "0 Office 365 Home msoffice \n", "24 Windows 10 ie \n", "53 Windows 7 ie \n", "54 Windows 7 ie \n", "58 Windows 7 ie \n", "\n", " text \n", "0 Unable to delete emails - message: The operati... \n", "24 Does IE11 Support HTML PTI ( PTI .102 PTI 384) \n", "53 Enabling cookies in Internet Explorer 10 \n", "54 How do I delete cookies and cache in IE PNS Wi... \n", "58 Multiple error messages on my IE 10. I have W... " ] }, "execution_count": 115, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data[data.answer_upvotes > 1].head()" ] }, { "cell_type": "code", "execution_count": 113, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "9533" ] }, "execution_count": 113, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(data)" ] }, { "cell_type": "code", "execution_count": 78, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\makayser\\AppData\\Local\\Continuum\\anaconda3\\envs\\nlp\\lib\\site-packages\\ipykernel_launcher.py:2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " \n", "C:\\Users\\makayser\\AppData\\Local\\Continuum\\anaconda3\\envs\\nlp\\lib\\site-packages\\ipykernel_launcher.py:3: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " This is separate from the ipykernel package so we can avoid doing imports until\n" ] }, { "data": { "text/plain": [ "7751" ] }, "execution_count": 78, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data_red = data.drop_duplicates(subset=['text'])\n", "data_red['text'] = data_red.text.replace('\\t',' ',regex=True).replace('\"','').replace(\"'\",' ').replace('\\n',' ',regex=True)\n", "data_red['subcat'] = data_red.subcat.replace('\\t',' ',regex=True).replace('\"','').replace(\"'\",' ').replace('\\n',' ',regex=True)\n", "len(data_red)" ] }, { "cell_type": "code", "execution_count": 79, "metadata": {}, "outputs": [], "source": [ "# data_red['subcat'] = data_red.subcat.str.replace(r'\\D', '')\n", "# data_red['text'] = data_red.text.str.replace(r'\\D', '')" ] }, { "cell_type": "code", "execution_count": 80, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "windows 5670\n", "msoffice 1227\n", "windowslive 317\n", "ie 175\n", "outlook_com 134\n", "mobiledevices 92\n", "insider 44\n", "edge 23\n", "protect 22\n", "surface 16\n", "skype 13\n", "bing 6\n", "feedback 5\n", "newmsn 4\n", "education_ms 1\n", "musicandvideo 1\n", "band 1\n", "Name: subcat, dtype: int64" ] }, "execution_count": 80, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data_red.subcat.value_counts()" ] }, { "cell_type": "code", "execution_count": 95, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "windows 5670\n", "msoffice 1227\n", "windowslive 317\n", "ie 175\n", "outlook_com 134\n", "mobiledevices 92\n", "insider 44\n", "edge 23\n", "protect 22\n", "surface 16\n", "Name: subcat, dtype: int64" ] }, "execution_count": 95, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tt = data_red[data_red.groupby('subcat').subcat.transform('size') > 14]\n", "tt.subcat.value_counts()" ] }, { "cell_type": "code", "execution_count": 104, "metadata": {}, "outputs": [ { "data": { "text/html": [ "

\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
subcat
0msoffice
8edge
22ie
175windows
217insider
302mobiledevices
968outlook_com
2221protect
2244skype
2264surface
5800windowslive
\n", "
" ], "text/plain": [ " subcat\n", "0 msoffice\n", "8 edge\n", "22 ie\n", "175 windows\n", "217 insider\n", "302 mobiledevices\n", "968 outlook_com\n", "2221 protect\n", "2244 skype\n", "2264 surface\n", "5800 windowslive" ] }, "execution_count": 104, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.DataFrame(data_red.subcat.drop_duplicates())" ] }, { "cell_type": "code", "execution_count": 108, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['band', 'education_ms', 'newmsn', 'musicandvideo', 'bing', 'feedback']" ] }, "execution_count": 108, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list(set(data.subcat.drop_duplicates()) - set(data_red.subcat.drop_duplicates()))" ] }, { "cell_type": "code", "execution_count": 81, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['msoffice',\n", " 'band',\n", " 'bing',\n", " 'edge',\n", " 'feedback',\n", " 'ie',\n", " 'windows',\n", " 'insider',\n", " 'mobiledevices',\n", " 'education_ms',\n", " 'outlook_com',\n", " 'musicandvideo',\n", " 'newmsn',\n", " 'protect',\n", " 'skype',\n", " 'surface',\n", " 'windowslive']" ] }, "execution_count": 81, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list(data_red.subcat.drop_duplicates())" ] }, { "cell_type": "code", "execution_count": 82, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "7733" ] }, "execution_count": 82, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data_red = data_red[data_red.subcat.isin(['msoffice',\n", " 'edge',\n", " 'ie',\n", " 'windows',\n", " 'insider',\n", " 'mobiledevices',\n", " 'outlook_com',\n", " 'protect',\n", " 'skype',\n", " 'surface',\n", " 'windowslive'])].copy()\n", "len(data_red)" ] }, { "cell_type": "code", "execution_count": 83, "metadata": {}, "outputs": [], "source": [ "data_red[['text','subcat']].head(6000).reset_index(drop=True).to_csv(he.get_config()['path']['sample_dir'] + 'train.txt', sep='\\t', encoding='utf-8', index=False)" ] }, { "cell_type": "code", "execution_count": 84, "metadata": {}, "outputs": [], "source": [ "data_red[['text','subcat']].tail(7733-6000).reset_index(drop=True).to_csv(he.get_config()['path']['sample_dir'] + 'test.txt', sep='\\t', encoding='utf-8', index=False)" ] } ], "metadata": { "kernelspec": { "display_name": "nlp", "language": "python", "name": "nlp" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.9" } }, "nbformat": 4, "nbformat_minor": 2 }