Answer the question
In order to leave comments, you need to log in
Prevent wrapping in Python when outputting a response?
Version of Python 2.7.14, it is necessary to display the table, but it does not fit on a line and it turns out that it transfers half of the table to a new line, how can this be avoided?
PS yes, like what to put after print, I tried it, it didn't help :)
def main():
""" main """
parsed_xml = et.parse("book.xml")
dfcols = ['author', 'name', 'publich', 'year','page']
df_xml = pd.DataFrame(columns=dfcols)
for node in parsed_xml.getroot():
author=node.find('author')
name = node.find('name')
publich = node.find('publich')
year = node.find('year')
page = node.find('page')
df_xml = df_xml.append(
pd.Series([getvalueofnode(author), getvalueofnode(name), getvalueofnode(publich),
getvalueofnode(year),getvalueofnode(page)], index=dfcols),
ignore_index=True)
print df_xml
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question