科学网

 找回密码
  注册
Pandas--basis
夏江江 2017-5-30 22:38
### pandas import pandas as pd import numpy as np s = pd.Series( ) dates = pd.date_range(20170101,periods=6) df = pd.DataFrame(np.random.randn(6,4),index = dates,columns= ) #index 定义行名字 #columns 定义列名字 df.dtypes df.index df.columns ...
个人分类: python|1930 次阅读|没有评论
Numpy-basis
夏江江 2017-5-30 22:37
##import matplotlib.pyplot as plt ##import numpy as np ## ### 坐标轴位置变化 ## ##plt.xlim(-5,5) ##plt.ylim(-4,4) ## ## ### ##ax = plt.gca() ##ax.spines .set_color(none) ##ax.spines .set_color(none) ##ax.xaxis.set_ticks_position(bottom) ##ax.yaxis.set_ticks_position( ...
个人分类: python|1663 次阅读|没有评论
读取NC的时间转换
夏江江 2017-5-18 11:20
from netCDF4 import num2date, date2num ncin = nc.Dataset(path+/+f) tim = ncin.variables ms = str(num2date(tim , units=tim.units, calendar=tim.calendar)) me = str(num2date(tim , units=tim.units, calendar=tim.calendar)) & ...
个人分类: python|5153 次阅读|没有评论
读写mat
夏江江 2017-4-19 13:40
import scipy.io as sio sio.savemat(rzweemd.mat,{U_value:imfs1,U_click:imfs2,U_imp:imfs3,U_revenue_U_clicks:imfs4}) dub = sio.loadmat(r'P:IAPBIGDATA花期results_accumulated_temperaturesresults_heatsum_new.mat ...
个人分类: python|1337 次阅读|没有评论
plt坐标轴字体大小
夏江江 2017-4-19 13:07
font = {'family' : 'normal', 'weight' : 'bold', 'size' : 22} matplotlib.rc('font', **font)
个人分类: python|3453 次阅读|没有评论
excel 2
夏江江 2017-4-5 13:00
import os import xlrd import shutil import xlwt import numpy as np from xlrd import xldate_as_tuple def position_list(c1,l1): pl= #第一行的名字 titles_row = sht.col_values(0) #第一列的名字 names = list(set(sht.c ...
个人分类: python|1355 次阅读|没有评论
excel
热度 1 夏江江 2017-4-5 10:02
import xlrd from xlrd import xldate_as_tuple from sys import path path.append(r'M:python') import MagicX a,b,c,mdid2 = MagicX.calendar_index() ################################################################################################### # # ...
个人分类: python|1370 次阅读|2 个评论 热度 1
names = list(set(jw))
夏江江 2017-4-4 20:30
import pickle import re import time fin = open(jw2017_2_jw.pkl,rb) jw = pickle.load(fin) jw = jw names = list(set(jw)) names.sort() nums = [] jt = .join(jw) for i,j in enumerate(names): a=time.clock() nums.append(jt.count(j)) ...
个人分类: python|1334 次阅读|没有评论
re.findall两字符间所有字符
夏江江 2017-4-4 13:42
re.findall(.*lat=(.*)lon=,s)
个人分类: python|1704 次阅读|没有评论

本页有 1 篇博文因作者的隐私设置或未通过审核而隐藏

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-11 16:00

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部