Going through pandas and matplot lib examples

This commit is contained in:
2025-12-05 19:43:21 +00:00
parent 4ad982d93d
commit 8e412c8f0a
5 changed files with 932 additions and 0 deletions

23
pandas-test.py Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env python
import pandas as pd
df = pd.DataFrame(
{
"Name": [
"Braund, Mr. Owen Harris",
"Allen, Mr. William Hentry",
"Bonnell, Miss. Elizabeth",
],
"Age": [22, 35, 58],
"Sex": ["male", "male", "female"],
}
)
print(df.describe())
titanic = pd.read_csv("titanic.csv")
print(titanic.head(8))
titanic.to_excel("titanic.xlsx", sheet_name="passengers", index=False)
titanic_xltest = pd.read_excel("titanic.xlsx", sheet_name="passengers")
print("INFO")
print(titanic.info())