Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

csv

Why does csvwriter.writerow() put a comma after each character?

August 14, 2022 by Magenaut

This code opens the URL and appends the /names at the end and opens the page and prints the string to test1.csv:

Categories Python, Q&A Tags csv, python Leave a comment

Using numpy.genfromtxt to read a csv file with strings containing commas

August 14, 2022 by Magenaut

I am trying to read in a csv file with numpy.genfromtxt but some of the fields are strings which contain commas. The strings are in quotes, but numpy is not recognizing the quotes as defining a single string. For example, with the data in ‘t.csv’:

Categories Python, Q&A Tags csv, genfromtxt, numpy, pandas, python Leave a comment

How to do row-to-column transposition of data in csv table?

August 14, 2022 by Magenaut

I’m new to scripting. I have a table (Table1.txt) and I need to create another table that has Table1’s rows arranged in columns and vice versa. I have found solutions to this problem for Perl and SQL but not for Python.

Categories Python, Q&A Tags csv, python Leave a comment

Split string on commas but ignore commas within double-quotes?

August 14, 2022 by Magenaut

I have some input that looks like the following:

Categories Python, Q&A Tags csv, double-quotes, python, regex, split Leave a comment

Error: Unsupported format, or corrupt file: Expected BOF record

August 14, 2022 by Magenaut

I am trying to open a xlsx file and just print the contents of it. I keep running into this error:

Categories Python, Q&A Tags csv, excel, python, xlrd Leave a comment

Python UTF-16 CSV reader

August 13, 2022 by Magenaut

I have a UTF-16 CSV file which I have to read. Python csv module does not seem to support UTF-16.

Categories Python, Q&A Tags csv, python, utf-16 Leave a comment

Key error when selecting columns in pandas dataframe after read_csv

August 13, 2022 by Magenaut

I’m trying to read in a CSV file into a pandas dataframe and select a column, but keep getting a key error.

Categories Python, Q&A Tags csv, pandas, python Leave a comment

Python Pandas read_csv skip rows but keep header

August 13, 2022 by Magenaut

I’m having trouble figuring out how to skip n rows in a csv file but keep the header which is the 1 row.

Categories Python, Q&A Tags csv, pandas, python Leave a comment

Pandas – write Multiindex rows with to_csv

August 13, 2022 by Magenaut

I am using to_csv to write a Multiindex DataFrame to csv files. The csv file has one column that contains the multiindexes in tuples, like:

Categories Python, Q&A Tags csv, multi-index, pandas, python Leave a comment

portable way to write csv file in python 2 or python 3

August 13, 2022 by Magenaut

On my Windows box, I usually did this in python 2 to write a csv file:

Categories Python, Q&A Tags csv, python, python-2.7, python-3.x, windows Leave a comment
Older posts
Newer posts
← Previous Page1 … Page10 Page11 Page12 … Page15 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress