Going through pandas and matplot lib examples
This commit is contained in:
23
pandas-test.py
Executable file
23
pandas-test.py
Executable 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())
|
||||
Reference in New Issue
Block a user