docker jupyter notebook pandas

官网参考Jupyter Docker Stacks — Docker Stacks documentation (jupyter-docker-stacks.readthedocs.io)

jupyter docker
https://jupyter-docker-stacks.readthedocs.io/en/latest/

docker run -p 10000:8888 jupyter/scipy-notebook:6b49f3337709

http://10.183.67.175:10000/?token=840d9ae3c76cabf9e2ce6787d77199bbd5cc401da8894415

// 重新启动docker 挂载目录
docker ps
[pechen@xxx-b3dev-rhel7 ju]$ docker ps
CONTAINER ID   IMAGE                                                                                         COMMAND                  CREATED              STATUS                  PORTS                                         NAMES                                                   gnb_cn1-bash_run_c11b2d9c7253
b79658042b0c   jupyter/scipy-notebook:6b49f3337709                                                           "tini -g -- start-no…"   16 hours ago         Up 16 hours (healthy)   0.0.0.0:10000->8888/tcp, :::10000->8888/tcp   brave_gauss                                                     gnb_cn1-bash_run_2e8ee08315f8

docker stop b79658042b0c
docker run -it --rm -p 10000:8888 -v "${PWD}":/home/jovyan/work jupyter/scipy-notebook:6b49f3337709

import pandas

df = pandas.read_csv('work/simulation.csv')

line1 = df.head(1)
y = line1.values[0]

import matplotlib.pyplot as plt
#import numpy as np
#t = np.arange(0, , 1)
plt.plot(y)
plt.ylabel('some numbers')
plt.show()

install openpyxl offline

et-xmlfile · PyPI  download from here.

https://pypi.org/project/et-xmlfile/#files

python3 -m pip install --no-index ./work/jdcal-1.4.1.tar.gz

python3 -m pip install --no-index ./work/et_xmlfile-1.1.0.tar.gz

python3 -m pip install --no-index ./work/openpyxl-3.0.10.tar.gz 

// save image

docker ps

CONTAINER ID   IMAGE                                                                                         COMMAND                  CREATED         STATUS                     PORTS                                         NAMES
1c0a75764628   jupyter/scipy-notebook:6b49f3337709 

docker commit 1c0a75764628 xlsx

REPOSITORY                                                                             TAG            IMAGE ID       CREATED         SIZE
xlsx                                                                                   latest  

docker run -it --rm -p 10000:8888 -v "${PWD}":/home/jovyan/work xlsx:latest
///

/

import pandas
df = pandas.read_excel('work/Nokia_5G_CELL_UL-BLER_Offenders.xlsx')
df.head()
col = list(df.columns)
col
df['OEM NR QAL Residual Block Error Ratio (BLER) for PDSCH (NR_5055a)']
df['CELL'].unique()

#select
data = df[(df['CELL']=='KCC02262S31')]
col_n = ['Period start time','OEM NR QAL Initial BLER in PUSCH (NR_5056b)']
select = data[col_n]
select

#封装的方法显示时间有问题
#ax = select.plot(kind = 'bar', x = 'Period start time' ,y = 'OEM NR QAL Initial BLER in PUSCH (NR_5056b)' , title = 'KCC02262S31 OEM NR QAL Initial BLER in PUSCH (NR_5056b)' , figsize = (20,10))


#//
from matplotlib import pyplot as plt
import matplotlib as mpl
from datetime import datetime, timedelta
import matplotlib.ticker as ticker
 
from datetime import datetime, timedelta
datalist = select['Period start time'].tolist()
# 根据ticker的功能改变第一个为初始的数据,第二个则为间隔
ticker_format = '%m/%d/%Y %H:%M'  # 日期的字符串数组
ticker_spacing = 0.125

dateFmt = mpl.dates.DateFormatter('%m/%d/%Y %H:%M')

# 创建画布
fig, ax = plt.subplots(1, 1)
fig.set_dpi(100)
plt.rcParams["figure.figsize"] = (20,3)
dates = [datetime.strptime(_,'%m/%d/%Y %H:%M') for _ in datalist]
plt.plot(dates, select['OEM NR QAL Initial BLER in PUSCH (NR_5056b)'].tolist())
ax.xaxis.set_major_formatter(dateFmt)
ax.xaxis.set_major_locator(ticker.MultipleLocator(ticker_spacing))
plt.xticks(rotation=90)
plt.show()
#values

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值