Skip to content

Commit 985fab3

Browse files
authored
Update example_csv.py
1 parent e1e1d28 commit 985fab3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sql-queries-6/run-sql-queries-on-csv-file/example_csv.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import pandas as pd from pandasql import sqldf
1+
import pandas as pd
2+
from pandasql import sqldf
3+
24
# Load the CSV file into a DataFrame
35
df = pd.read_csv('data.csv')
46

@@ -14,4 +16,4 @@
1416
# Example 2: Count individuals by gender
1517
count_gender_query = "SELECT sex, COUNT(*) AS count FROM df GROUP BY sex"
1618
count_gender = pysqldf(count_gender_query)
17-
print(count_gender)
19+
print(count_gender)

0 commit comments

Comments
 (0)