Python – Convert CSV to List of Lists

Problem Formulation Given a CSV file (e.g., stored in the file with name ‘my_file.csv’). INPUT: file ‘my_file.csv’ 9,8,7 6,5,4 3,2,1 Challenge: How to convert it to a list of lists (=nested list), i.e., putting the row values into the inner lists? OUTPUT: Python list of lists [[9, 8, 7], [6, 5, 4], [3, 2, 1]] … Read more

Best Programming Languages to Start Freelancing in 2023

The demand for programming talent has steadily increased in the preceding decades. In fact, there never has been a better time to start learning to code. Why? Because you (yes, YOU! 🧬) can sell your skills for top dollars: The average freelancer earns much more than $100,000 per year. Nobody denies two transformative trends: Programming … Read more

Finxter Mission – Help Increase Collective Intelligence

πŸš€ The mission of Finxter is to help increase collective intelligence. What does it mean to increase collective intelligence? In my view, humanity it’s like a big organism. You and I are two cells of this big organism. There are communication channels between those cells — for example, video, audio, speech, etc. There are many … Read more

Python Convert CSV to Parquet

import pandas as pd df = pd.read_csv(‘my_file.csv’) df.to_parquet(‘my_file.parquet’) Problem Formulation Given a CSV file ‘my_file.csv’. How to convert the file to a Parquet file named ‘my_file.parquet’? πŸ’‘ Info: Apache Parquet is an open-source, column-oriented data file format designed for efficient data storage and retrieval using data compression and encoding schemes to handle complex data in … Read more

Top 6 Developer Jobs for White-Hat Hackers in 2023

Hackers have a wide variety of specific skills that are super valuable in a “white hat” environment. If you’re interested in leaving the “dark side” or you simply want to reduce your risk profile as a hacker—these could be some interesting career paths you could pursue easily without needing to learn a whole new stack … Read more

You Cannot Use Python Regex in startswith(). Do This Instead.

I’m sitting in front of my computer refactoring Python code and have just thought of the following question: Can You Use a Regular Expression with the Python string.startswith() Method? The short answer is no. The string.startswith() method doesn’t allow regular expression inputs. And you don’t need it because regular expressions can already check if a … Read more

Convert CSV to Dictionary in Python

The best way to convert a CSV file to a Python dictionary is to create a CSV file object f using open(“my_file.csv”) and pass it in the csv.DictReader(f) method. The return value is an iterable of dictionaries, one per row in the CSV file, that maps the column header from the first row to the … Read more