i have a json string that need to be convert to a dataframe with desired column name.
my_json = {'2017-01-03': {'open': 214.86,
'high': 220.33,
'low': 210.96,
'close': 216.99,
'volume': 5923254},
'2017-12-29': {'open': 316.18,
'high': 316.41,
'low': 310.0,
'close': 311.35,
'volume': 3777155}}
Run Code Online (Sandbox Code Playgroud)
use below code doesn't give the format i want
pd.DataFrame.from_dict(json_normalize(my_json), orient='columns')
Run Code Online (Sandbox Code Playgroud)
my expected format is below
Not sure how to do it?
我有一张图像需要进行 OCR(光学字符识别)来提取所有数据。
首先,我想将彩色图像转换为白色背景上的黑色文本,以提高 OCR 准确性。
我尝试下面的代码
from PIL import Image
img = Image.open("data7.png")
img.convert("1").save("result.jpg")
Run Code Online (Sandbox Code Playgroud)
它给了我下面不清楚的图像
我期望有这个图像
然后,我将使用 pytesseract 来获取数据框
import pytesseract as tess
file = Image.open("data7.png")
text = tess.image_to_data(file,lang="eng",output_type='data.frame')
text
Run Code Online (Sandbox Code Playgroud)
最后,我想要得到的数据框如下
python image-processing image-segmentation tensorflow pytorch