Skip to content

Tag: python

Fill cells with colors using openpyxl?

I am currently using openpyxl v2.2.2 for Python 2.7 and i wanted to set colors to cells. I have used the following imports and the following is the code I tried using: but I get the following error: Any idea on how to set cell A1 (or any other cells) with colors using openpyxl? Answer I believe the issue is

Python – Brute force generator

I’ve made a brute force password cracker which works, but I also made a string combining generator which would be better as the brute force string generator; however I can’t figure out how to combine the two. Brute force code: Character generator code: I would like to replace the “Generating…

Pandas read multiindexed csv with blanks

I’m struggling with properly loading a csv that has a multi lines header with blanks. The CSV looks like this: What I would like to get is: When I try to load with pd.read_csv(file, header=[0,1], sep=’,’), I end up with the following: Is there a way to get the desired result? Note: alternati…

List of unicode character names

In Python I can print a unicode character by name (e.g. print(u’N{snowman}’)). Is there a way I get get a list of all valid names? Answer Every codepoint has a name, so you are effectively asking for the Unicode standard list of codepoint names (as well as the *list of name aliases, supported by P…

Change Series inplace in DataFrame after applying function on it

I’m trying to use pandas in order to change one of my columns in-place, using simple function. After reading the whole Dataframe, I tried to apply function on one Series: And it’s working great. The only problem occurs when I try to put it back into my DataFrame: or: Throwing the following warning…