Linked Questions

-2 votes
1 answer
934 views

I try to convert from json to csv, But there is Extra letter "u" has been appeared before every word in list , i used pandas to read this csv data, this is my code : import json import csv with open(...
Mohammed Khalifa's user avatar
0 votes
1 answer
148 views

A query to a database returns a tuple like this: (u'Elia extends Feyenoord deal',) Now I want to strip this down to the part which is in single quotes only, like a string. Something like: 'Elia ...
Code Bunny's user avatar
-2 votes
2 answers
64 views

I'm trying to edit a Python module, but I'm not getting the value I expect from a variable. The code is: def populate_ipv4_interfaces(self, data): for key, value in data.items(): vrf =...
Soop's user avatar
  • 437
-1 votes
1 answer
70 views

My list contains a number of stock symbols but for some reason everyone has a leading u. I was wondering how I could strip the u away? This is the list [u'GOLD', u'AEM', u'CDE', u'CLF', u'FOE', u'HL',...
Ggd Hhdhd's user avatar
  • 145
-3 votes
1 answer
64 views

import json def read_json(filename): dt = {} fh = open(filename, "r") dt = json.load(fh) return dt def print_values_order_by_keys(dt): sorted_keys = sorted(dt) print ...
helpmeplease's user avatar
346 votes
5 answers
338k views

Like in: u'Hello' My guess is that it indicates "Unicode", is that correct? If so, since when has it been available?
OscarRyz's user avatar
  • 200k
141 votes
2 answers
137k views

Yes in short i would like to know why am I seeing a u in front of my keys and values. I am rendering a form. The form has check-box for the particular label and one text field for the ip address. I ...
user1488987's user avatar
  • 1,463
5 votes
4 answers
1k views

I tried the following on Codecademy's Python lesson hobbies = [] # Add your code below! for i in range(3): Hobby = str(raw_input("Enter a hobby:")) hobbies.append(Hobby) print hobbies With ...
user1936752's user avatar
5 votes
2 answers
4k views

I've wrote a simple script to extract data from some site. Script works as expected but I'm not pleased with output format Here is my code class ArticleSpider(Spider): name = "article" ...
GriMel's user avatar
  • 2,330
1 vote
1 answer
10k views

I am trying to open an excel workbook and iterate through each of the worksheets in a loop. Here is first loop: wb = openpyxl.load_workbook('snakes.xlsx') for i in wb.worksheets: i= 0 wb....
spacedinosaur10's user avatar
-1 votes
1 answer
4k views

I have got the following .json file that has to be converted into a Python list of lists for further analysis. Here is how the input looks like: [{"RFA_2F":4,"RFA_2A":"E","TARGET_B":0,"LASTGIFT":5,"...
Maiia S.'s user avatar
  • 321
1 vote
1 answer
3k views

I want to extract all the hashtags from a given website: For example, "I love #stack overflow because #people are very #helpful!" This should pull the 3 hashtags into a table. In the website I am ...
Video retrieval's user avatar
0 votes
2 answers
1k views

I'm a newbie in python. And apologies for a very basic question. I'm working with python pattern.en library and try to get the synonyms of a word. this is my code and is working fine. from pattern....
Safrana Shereen's user avatar
0 votes
1 answer
1k views

I am adding to a dictionary by doing .append within python theDict = defaultdict(list) theDict[theKey].append(theValue) I'll try to print it out via print theDict[valueKeyToLookUp] But it always ...
king's user avatar
  • 1,352
1 vote
2 answers
2k views

I've successfully used BeautifulSoup to iterate through a few hundred pages of the bandsintown webpage, viewed here: https://www.bandsintown.com/?came_from=257&page=102 I'm able to iterate ...
DiamondJoe12's user avatar
  • 1,849

15 30 50 per page