Liu-Jincan / study-fpm

学习fortran-package-manager(fpm)的过程记录~~
0 stars 0 forks source link

5 #5

Open Liu-Jincan opened 2 years ago

Liu-Jincan commented 2 years ago

https://stackoverflow.com/questions/36294712/python-filename-contains-string-metachar

Liu-Jincan commented 2 years ago

https://read.qidian.com/chapter/odSsbxAz_odxo3Pbs2jtrw2/sph8mPFoOTz6ItTi_ILQ7A2/

Liu-Jincan commented 2 years ago

https://blog.51cto.com/u_15357029/4976994

Liu-Jincan commented 2 years ago

TypeError: unsupported type for timedelta seconds component: numpy.int32

Liu-Jincan commented 2 years ago

NameError: name 'Dataset' is not defined

Liu-Jincan commented 2 years ago

from netCDF4 import Dataset

Liu-Jincan commented 2 years ago

https://www.cnblogs.com/wodexk/p/10316793.html

Liu-Jincan commented 2 years ago

https://blog.csdn.net/uncle_ll/article/details/122439405

Liu-Jincan commented 2 years ago

type list doesn't define round method

Liu-Jincan commented 2 years ago

https://stackoverflow.com/questions/5326112/how-to-round-each-item-in-a-list-of-floats-to-2-decimal-places

Liu-Jincan commented 2 years ago

https://blog.csdn.net/bqw18744018044/article/details/79934285

Liu-Jincan commented 2 years ago

https://mp.weixin.qq.com/s/u0o0fDNzr9fRTTF0r9a2jQ

Liu-Jincan commented 2 years ago

0 2022-08-15 15:00:00 -61.333 68.570 2.506 1 2022-08-15 15:00:00 -60.689 68.161 4.917 2 2022-08-15 15:00:00 -60.037 67.761 5.494 3 2022-08-15 15:00:00 -59.385 67.376 5.373 4 2022-08-15 15:00:00 -58.732 67.004 5.792

Liu-Jincan commented 2 years ago

某一时刻某一地点的卫星数据能否匹配到多个网格点? 一般采用的是匹配最近的网格点,但是可能也存在很多离的很近的点,

Liu-Jincan commented 2 years ago

pandas 找出重复行并且取均值后合并 - 简书

Liu-Jincan commented 2 years ago

https://www.jianshu.com/p/ae94c28f2ad8

Liu-Jincan commented 2 years ago
import pymongo,pandas as pd
from bson import ObjectId

conn=pymongo.MongoClient()

cursor=conn.bulk_commodities.prices.find(
    {'commodity_id':ObjectId("59b8fbadf00ab111208624f9"),
    'price_type':'出厂价'}).sort('price_at',pymongo.ASCENDING)
aluminum_list=list(cursor)
aluminum_df=pd.DataFrame(aluminum_list)
# 删除columns 的方法
aluminum_df.drop(['commodity_id',
 'company_id','price_type',
'priced_by','created_at','_id','price_at'],
axis=1,inplace=True)
# 刻意添加一条重复数据方便测试复杂情况
# 在dataframe 中添加 row 的方法
aluminum_df=aluminum_df.append(
   pd.DataFrame({'publish_time':['2017-08-21'],
   'price':[16082]}))

print '初始数据,2017-08-18 和 2017-08-21 两天都有重复数据'
print aluminum_df.head(10)
print aluminum_df.tail(1)
print '\n-------------------------------------------------'

# 找出指定的 column 中重复的 rows
# 这个方法很实用
d_rows=aluminum_df[aluminum_df['publish_time'].duplicated(keep=False)]

print '用duplicated方法找出的重复数据'
print d_rows
print '\n-------------------------------------------------'

# 曾经在这里犯过错,不能用下面的方法来删除
# 因为一边删除  aluminum_df,  aluminum_df 的 index 也在发生变化!
# d_count=d_rows['price'].size
# for i in range(d_count):
    # 删掉重复的 rows
    # 这里 row_id 是固定的
    # 不用考虑删除后会变化的问题
    # aluminum_df.drop([d_rows.index[i]],axis=0,inplace=True)
# 正确的方法应该还是用 drop :
aluminum_df.drop(d_rows.index,axis=0,inplace=True)

# 将重复的数据分组
# 分组后取均值,分别创建新的 row
g_items=d_rows.groupby('publish_time').mean()
g_items['publish_time']=g_items.index

# 将新的 row加入到原有数据并且重整
aluminum_df=aluminum_df.append(g_items)
aluminum_df.sort_values(by='publish_time',inplace=True,ascending=False)

aluminum_df.set_index(aluminum_df['publish_time'],inplace=True)
aluminum_df.drop(['publish_time'],axis=1,inplace=True)

print '重整后的数据'
print aluminum_df.tail(8)
Liu-Jincan commented 2 years ago

image

Liu-Jincan commented 2 years ago

图片

Liu-Jincan commented 2 years ago

图片

Liu-Jincan commented 2 years ago

https://towardsdatascience.com/modern-parallel-and-distributed-python-a-quick-tutorial-on-ray-99f8d70369b8

Liu-Jincan commented 2 years ago

图片

Liu-Jincan commented 2 years ago

图片