24 lines
570 B
Python
Executable File
24 lines
570 B
Python
Executable File
#!/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())
|