Skip to content

Instantly share code, notes, and snippets.

@phpmaps
Created November 15, 2023 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpmaps/19482d9bb52a875682e9dd7edac34b85 to your computer and use it in GitHub Desktop.
Save phpmaps/19482d9bb52a875682e9dd7edac34b85 to your computer and use it in GitHub Desktop.
Python CSV
import pandas as pd
# Specify the CSV file path
csv_file_path = 'your_file.csv'
# Specify the column name you want to print
column_name = 'your_column_name' # Change this to the actual column name
# Read the CSV file into a pandas DataFrame
df = pd.read_csv(csv_file_path)
# Check if the specified column exists in the DataFrame
if column_name in df.columns:
# Print the specified column
print(df[column_name])
else:
print(f"Column '{column_name}' not found in the CSV file.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment