How to Convert a DBF to a CSV in Python?

Background πŸ’‘ A dBase database file (DBF) is a database file format with the .dbf file extension used by various applications and database systems. πŸ’‘ A comma-separated values (CSV) file is a text file that uses a comma to separate fields of a data record (=line). Problem Formulation Given a .dbf file my_db.dbf. How to … Read more

How to Convert Tab-Delimited File to CSV in Python?

The easiest way to convert a tab-delimited values (TSV) file to a comma-separated values (CSV) file is to use the following three lines of code: import pandas as pd df = pd.read_csv(‘my_file.txt’, sep=’\t’, header=None) df.to_csv(‘my_file.csv’, header=None) We’ll explain this and other approaches in more detail next—scroll down to Method 3 for this exact method. Problem … Read more

How to Convert a CSV.gz to a CSV in Python?

To convert a compressed CSV file (.csv.gz) to a CSV file (.csv) and read it in your Python shell, use the gzip.open(filename, ‘rt’, newline=”) function call to open the gzipped file, the file.read() function to read its contents, and the file.write() function to write the CSV in a normal (unzipped) file. The gzip.open() function has … Read more

How to Convert a List of Dicts to a CSV File in Python [4 Ways]

Problem: How to convert a list of dictionaries to a csv file? Example: Given is a list of dicts—for example salary data of employees in a given company: Your goal is to write the content of the list of dicts into a comma-separated-values (CSV) file format. Your out file should look like this: my_file.csv: Name,Job,Salary … Read more

3 Simple Steps to Convert calendar.ics to CSV/Excel in Python

Step 1: Install csv-ical Module with PIP Run the following command in your command line or PowerShell (Windows) or shell or terminal (macOS, Linux, Ubuntu) to install the csv-ical library: In some instances, you need to modify this command a bit to make it work. If you need more assistance installing the library, check out … Read more

How to Sort Words Alphabetically in Python

Problem Formulation and Solution Overview In this article, you’ll learn how to sort words alphabetically in Python. To make it more fun, we have the following running scenario: Some English sayings, also known as Tongue-Twisters, are fun to try and say quickly. They are also used to improve non-English speaking individuals and small children’s fluency … Read more

Python CSV to UTF-8

This article concerns the conversion and handling of CSV file formats in combination with the UTF-8 encoding standard. πŸ’‘ The Unicode Transformation Format 8-Bit (UTF-8) is a variable-width character encoding used for electronic communication. UTF-8 can encode more than 1 million (more or less weird) characters using 1 to 4 byte code units. Example UTF-8 … Read more

Best Solidity Linter

πŸ’‘ A code linter is a static code analysis tool to find programming errors, bugs, style mistakes, and suspicious constructs. The best Solidity Linter is Ethlint with a close second Solhint. Most other linters are not well qualified to compete with those early tools! Solidity Linter #1 – Ethlint Ethlint comes with the popular slogan … Read more