truncation

Pandas truncates strings in numpy list

Pandas truncates strings in numpy list Question: Consider the following minimal example: @dataclass class ExportEngine: def __post_init__(self): self.list = pandas.DataFrame(columns=list(MyObject.CSVHeaders())) def export(self): self.prepare() self.list.to_csv("~/Desktop/test.csv") def prepare(self): values = numpy.concatenate( ( numpy.array(["Col1Value", "Col2Value", " Col3Value", "Col4Value"]), numpy.repeat("", 24), ) ) for x in range(8): #not the best way, but done due to other constraints start = …

Total answers: 2

python: avoiding zip truncation of list

python: avoiding zip truncation of list Question: I have the following python code that uses zip() and it seems to cause unintended data truncation. inc_data = [[u’Period Ending’, u’Dec 31, 2012′, u’Dec 31, 2011′, u’Dec 31, 2010′], [u’Total Revenuen’, u’104,507,100n’, u’106,916,100n’, u’99,870,100n’], [u’Cost of Revenuen’,u’56,000,000n’] ] inc_data2 = zip(*inc_data) for i in inc_data2: print i …

Total answers: 2