Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

csv

Python import csv to list

Using the csv module: Output: If you need tuples: Output: Old Python 2 answer, also using the csv module:

Categories Python Tags csv, python

How can I import an Excel file into SQL Server?

I have data in an Excel file – actually XLSX format since it is now 2020. My requirement is to get this data into SQL Server as follows: ad hoc, the use case being feeding tables with test data, or infrequent data loads of small amounts of data (say < 3k rows), and In a repeatable, robust, … Read more

Categories sql server Tags csv, excel, import, oledb, sql-server

Creating a dictionary from a csv file?

I believe the syntax you were looking for is as follows: Alternately, for python <= 2.7.1, you want:

Categories Python Tags csv, dictionary, list-comprehension, python

ORA-29913: error in executing ODCIEXTTABLEOPEN callout when inserting csv into oracle

Try something like this. Replace ‘NikitaBuriak’ with the ID you used when you created the table..

Categories Uncategorized Tags csv, oracle, plsql

(unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: truncated \UXXXXXXXX escape

I’m trying to read a .csv file into Python (Spyder) but I keep getting an error. My code: I get the following error: SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: truncated \UXXXXXXXX escape I have tried to replace the \ with \ or with / and I’ve tried to put an … Read more

Categories Python Tags csv, python, syntax-error, unicode

ValueError: cannot index with vector containing NA / NaN values

The error message means that the dataframe contains blank entries that default to na/NaN. You can just add na=False in the synatx to fill value for missing values.

Categories Python Tags csv, excel, python, string

Convert from CSV to array in Python

You should use the csv module: This gives:

Categories Python Tags csv, python

TypeError: list indices must be integers or slices, not str

First, array_length should be an integer and not a string: Second, your for loop should be constructed using range: Third, i will increment automatically, so delete the following line: Note, one could also just zip the two lists given that they have the same length:

Categories Python Tags arrays, csv, list, python

Convert XML to CSV file

Do not use the findall function, as it will look for att tags in the whole tree. Just iterate the tree in order from top to bottom and grab the relevant elements in them. Which gives:

Categories Python Tags csv, elementtree, python, xml, xpath

Create a .csv file with values from a Python list

Edit: this only works with python 2.x. To make it work with python 3.x replace wb with w (see this SO answer)

Categories Python Tags csv, python, xlrd
Older posts
Newer posts
← Previous Page1 … Page15 Page16 Page17 … Page19 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress