关闭

Python-Matplotlib(5) 可视化图表细节

#Color import pandas as pd import matplotlib.pyplot as pltwomen_degrees = pd.read_csv('percent-bachelors-degrees-women-usa.csv') major_cats = ['Biology', 'Computer Science', 'Engineering', 'Math and St...
阅读(37) 评论(0)

Python-Matplotlib(4) 基于真实数据集的可视化分析

import pandas as pd import matplotlib.pyplot as pltwomen_degrees = pd.read_csv('percent-bachelors-degrees-women-usa.csv') plt.plot(women_degrees['Year'], women_degrees['Biology']) plt.show()#100-women_...
阅读(38) 评论(0)

Python-Matplotlib(4) 直方图与四分图

import pandas as pd import matplotlib.pyplot as plt reviews = pd.read_csv('fandango_scores.csv') cols = ['FILM', 'RT_user_norm', 'Metacritic_user_nom', 'IMDB_norm', 'Fandango_Ratingvalue'] norm_reviews...
阅读(49) 评论(0)

Python-Matplotlib(3) 条形图实战

import pandas as pd reviews = pd.read_csv('fandango_scores.csv') cols = ['FILM', 'RT_user_norm', 'Metacritic_user_nom', 'IMDB_norm', 'Fandango_Ratingvalue', 'Fandango_Stars'] norm_reviews = reviews[col...
阅读(32) 评论(0)

Python-Matplotlib(2)打造一个完整的折线图

import pandas as pd import matplotlib.pyplot as pltunrate = pd.read_csv('unrate.csv') unrate['DATE'] = pd.to_datetime(unrate['DATE']) first_twelve = unrate[0:12] plt.plot(first_twelve['DATE'], first_tw...
阅读(38) 评论(0)

Python-Matplotlib(1)画折线图

import pandas as pd unrate = pd.read_csv('unrate.csv') unrate['DATE'] = pd.to_datetime(unrate['DATE']) print(unrate.head(12))import matplotlib.pyplot as plt #%matplotlib inline #Using the different pyp...
阅读(31) 评论(0)

Python-Pandas(6)数据索引变换

import pandas as pd#will return a new DataFrame that is indexed by the values in the specified column #and will drop that column from the DataFrame #without the FILM column dropped fandango = pd.read...
阅读(35) 评论(0)

Python-Pandas(5)核心数据结构Series详解

#Series (collection of values) #DataFrame (collection of Series objects) #Panel (collection of DataFrame objects)#A Series object can hold many data types, including #float - for representing float val...
阅读(25) 评论(0)

Python-Pandas(4)自定义函数方法

#specifying axis=1 or axis='columns' will drop any columns that have null values drop_na_columns = titanic_survival.dropna(axis=1) new_titanic_survival = titanic_survival.dropna(axis=0,subset=["Age", "...
阅读(44) 评论(0)

Python-Pandas(3)数据预处理

import pandas as pd import numpy as np titanic_survival = pd.read_csv("titanic_train.csv") titanic_survival.head()#The Pandas library uses NaN, which stands for "not a number", to indicate a missing va...
阅读(30) 评论(0)

Python-Pandas(2)数值计算与排序

import pandas food_info = pandas.read_csv("food_info.csv") col_names = food_info.columns.tolist() print(col_names) print(food_info.head(3))#print food_info["Iron_(mg)"] #div_1000 = food_info["Iron_(mg)...
阅读(18) 评论(0)

Python-Pandas(1)数据读取与显示,数据样本行列选取

import pandas food_info = pandas.read_csv("food_info.csv") #print(type(food_info)) print food_info.dtypes#first_rows = food_info.head() #print first_rows #print(food_info.head(3)) #print food_info.colu...
阅读(33) 评论(0)
46条 共4页1 2 3 4 下一页 尾页
    个人资料
    • 访问:2780次
    • 积分:481
    • 等级:
    • 排名:千里之外
    • 原创:45篇
    • 转载:0篇
    • 译文:0篇
    • 评论:0条
    文章分类
    文章存档