Cannot plot candlestick data from Huobi json data

import pandas as pd import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as mticker from matplotlib.finance import candlestick_ohlc import matplotlib.dates as mdates import datetime as dt import urllib impor...
more »

2017-04-19 22:04 (2) Answers

Python tnsnames.ora parser

Good afternoon. I need a dict containing all database connections from tnsnames.ora file. I need to go from this : (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=mydbserver.mydomain.com)(PORT=1521)))(CONNECT_DATA=(SID=CATAL)(SERVER=DEDIC...
more »

2017-04-19 16:04 (1) Answers

How to modify full text of some columns in pandas

I got a fairly big dataframe from a csv in pandas. The problem is that on some columns I get strings of text which I would like to isolate the last character to turn it into integers. I found a solution, but I am fairly sure it's not the most effic...
more »

2017-04-18 23:04 (2) Answers

input check functions in python classes

I want to create a check on inputs of a particular class, I have the following made up example: class NmbPair: def __init__(self, a = None, b = None): self.a = a self.b = b def __eq__(self, other): if self.a == other...
more »

2017-04-18 09:04 (1) Answers

Total size of email in python

I am using the imaplib of python to get emails from a server. These emails will be forwarded. Based on the total size of the individual email the attachments will be dropped or forwarded with the message. But how do I get the total size of a email.me...
more »

2017-04-15 23:04 (0) Answers

time series from list of dates-python

I have a list of dates (ListA) each entry in which represents an occurrence. How do I make a time series out of the list in python3? A sequence of dates would be on the X axis, and the frequency of each date would be on the Y ListA = [2016-04-05, 2...
more »

2017-04-14 19:04 (1) Answers

Creating list of 2D matrices in Python

I am trying to create a list of 2d matrices, as per the illustration below: list of 2d matrices Basically, I want to start with a NxN matrix with all zeros and sequentially replace the 0's with 1's (as shown in the image). With each modification ch...
more »

2017-04-13 03:04 (1) Answers

dividing columns in pandas

It's been a while for me to try figure out what is wrong with my code, but I guess I need help. Here is my problem. I have two dataframe which I want to divide each other, but the result was always NaN. In: merged.head() Out: 1...
more »

2017-04-11 12:04 (1) Answers

Spacy and sputnik issue on Python3

I am currently using space(0.101.0), tensorflox (1.0.0) and sputnik (0.9.3). I do have this issue happening : super(Pool, self).__init__(app_name, app_version, path, **kwargs) File "/Users/sebastien/xxx/venv/lib/python3.6/site-packages/sputnik/...
more »

2017-04-10 22:04 (0) Answers

How to set a custom separator in pandas to_csv()?

From the docs I know that in order to save as a .csv file one can simply do: df.to_csv(sep = ';') However, I would like to use my custom separator, for instance: :::. How can I set ::: as a separator?. I tried to: df.to_csv(sep = ':::') And go...
more »

2017-04-10 15:04 (2) Answers

Inheritance NameError?

I tried the following double linked list practice. And my question is how do I take out the _Node class and store it as a module, then import it into the DoubleLinkedBase class. It keeps throwing me NameError if I try to do that. e.g. if I save the...
more »

2017-04-10 03:04 (0) Answers