- import polars as pl
- # Read csv1 and csv2
- csv1 = pl.read_csv('csv1.csv')
- csv2 = pl.read_csv('csv2.csv')
- # Specify the column name to check
- column_name = 'column_name' # Replace with the actual column name
- # Extract the column from csv1
- csv1_column = csv1[column_name]
- # Extract the column from csv2
- csv2_column = csv2[column_name]
- # Check if all values in csv1 column are present in csv2 column
- all_present = csv1_column.isin(csv2_column).all()
- # Print the result
- if all_present:
- print("All values in csv1 column are present in csv2 column.")
- else:
- print("Not all values in csv1 column are present in csv2 column.")
[text] Polars
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new:
File Description
- Polars
- Paste Code
- 09 Jun-2023
- 653 Bytes
You can Share it:
Latest Code Pastes