Created
March 6, 2024 17:54
-
-
Save quantra-go-algo/4d70d9b5d98f9b88447de9456af59f50 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import the libraries | |
import pandas as pd | |
import cudf | |
# Creating a Pandas DataFrame | |
pandas_data = { | |
'A': [1, 2, 3, 4, 5], | |
'B': [10, 20, 30, 40, 50], | |
'C': ['a', 'b', 'c', 'd', 'e'] | |
} | |
pandas_df = pd.DataFrame(pandas_data) | |
# Display the Pandas DataFrame | |
print("Pandas DataFrame:") | |
print(pandas_df) | |
# Convert Pandas DataFrame to cuDF DataFrame | |
cudf_df = cudf.DataFrame.from_pandas(pandas_df) | |
# Display the cuDF DataFrame | |
print("cuDF DataFrame:") | |
print(cudf_df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment