How to remove words in the images
Python Forum » Data Science
by CK12780
1w ago
import matplotlib.pyplot as plt predicted_images_path = os.path.abspath("/content/predicted") dataset_dicts_validation = DatasetCatalog.get('void-detection-2-valid') for d in dataset_dicts_validation: im = cv2.imread(d["file_name"]) outputs = predictor(im) v = Visualizer(im[:, :, ::-1], metadata = metadata, scale=0.5, instance_mode=ColorMode.IMAGE_BW ) out = v.draw_instance_predictions(outputs["instances"].to("cpu")) fig = plt.figure(frameon=False, dpi=1) fig.set_size_inches(1024,1024) ax = plt.Axes(fig, [0., 0., 1., 1.]) ax.set_axis_off() fig.add_axes(ax) ax.imshow(cv2.cvtColor(out.get_image ..read more
Visit website
Cloud computing advice needed
Python Forum » Data Science
by sawtooth500
1w ago
I'm doing stock backtesting using Python - and I've pretty much maxed the computational abilities of my local machines. So I'm looking for some cloud computing advice. Regarding my code, I had a deep dive this morning with a friend of mine who is a data scientist and very experienced in python - she basically told me you either need more hardware to do what you want to do, or write it in C. For right now, getting more hardware seems like the path of less resistance than doing all my stuff in C so.... So there are 3 roads I can go down: 1. Build my own high end custom rig at home with like 1 ..read more
Visit website
Dynamically plotting graphs with matplotlib
Python Forum » Data Science
by CAD79
1w ago
I'm trying to create an application that formats data from a data logger that I have coded using an Arduino. I have the code finished and the output data is, for example: Quote:Time,Sw,28C5 53782,1,27.89 53792,1,26.34 53802,1,27.89 53812,1,27.89 53822,1,25.95 53832,0,27.89 53842,0,26.42 53852,0,24.49 53862,1,27.89 53872,1,27.89 53882,0,27.89 53892,1,30.07 53902,1,27.89 53912,1,24.67 53922,1,33.93 53932,1,31.45 53942,1,27.89 53952,0,24.68 53962,1,22.11 53972,1,21.79 I use pandas to put it into an excel sheet, but to plot the data as a graph is the part of which I am not sure of. As I want to ..read more
Visit website
Cubic spline Graph Interpretation how?
Python Forum » Data Science
by GREEN369
1w ago
Hi Friends, i am new to python i want to calculate the r2 value for the cubic spline graph and how the results are intercepted from the graph based on the standard b/b0 and concentration values i am attaching a image file for your reference please any one can help me to rewrite the code logic for the calculation of cubic spline graph generation the formula for cubic spline calculation is as below The function S(x)∈C2[a,b], and it is a cubic polynomial on each cell [xj,xj+1], where a = x0 <x1<...< xn= b is a given node, then S(x) is called a cubic spline function on nodes x0, x1,...x ..read more
Visit website
Process Mining: OCEL creation from CSV with PM4PY
Python Forum » Data Science
by kldgee
2w ago
Hi, I am currently trying to create an object-centric event log from a csv-file, which I am using the PM4PY library to. This is the function I created to achieve that: def read_and_convert_to_ocel(filename): # Read the CSV file into a DataFrame ev = pd.read_csv(filename) # Convert the "ocel:timestamp" column to datetime format ev['ocel:timestamp'] = pd.to_datetime(ev['ocel:timestamp'], format='%Y-%m-%d %H:%M:%S') # Convert all columns except "ocel:timestamp" to string cols_to_convert = ev.columns.drop('ocel:timestamp') ev[cols_to_convert] = ev[cols_to_convert].as ..read more
Visit website
Address Extraction
Python Forum » Data Science
by standenman
2w ago
I am trying to map out a strategy for extracting text data from a pdf files. The files are semi-structured and would be created by the social security administration using iText. I have attached an example file. I want to extract the name and address of the “provider”. Seems not too hard at first, but we are talking pdf files, right? The problem has two major parts: identification and extraction of the desired text, then the cleaning of the text. Here are my efforts so far. I was able to identify the bbox coordinates of the “provider and address” and this worked ok for several test pdfs unti ..read more
Visit website
Python sympy problem for symbolic equation definition
Python Forum » Data Science
by joellapointe_engineering
1M ago
I have a problem forming a symbolic equation with the sympy command "sp.Eq()".I have an Excel sheet with equations formed by concatenation of cells as follow : Then, an Excel concatenation is done to form the equation : '+F_WORM_X*1+R_WORM_LOW_BEA_X*1+R_WORM_UP_BEA_X*1+F_WORM_FRIC_X*1' So this Excel equation is put in a panda dataframe from the Excel sheet : Quote:FBD_WORM_ = pd.read_excel("FUSION EPS_LOAD CASE_BIGBLUE_V03.xlsx", sheet_name = "FBD worm", ) And the symbolic equation is formed from the content of the dataframe : Quote:EQ_W_1 = sp.Eq(FBD_WORM_.iloc[14, 3], 0) It gives me ..read more
Visit website
[Numpy] How to store different data type in one numpy array?
Python Forum » Data Science
by water
1M ago
I want to store different data type in on numpy array, b = np.array([['2024-03-22', 71.0, 'ceh'], ['2024-03-23', 63.0, 'abc']]) and specific dtype likes: [['datetime64[D]', 'float64', 'string'], ['datetime64[D]', 'float64', 'string']] how to define that ..read more
Visit website
Excel iterations and restrictions
Python Forum » Data Science
by marialage98
1M ago
Hello, i have an excel file that has columns with circular references. And i want to use python to apply restrictons to those columns. I have a column 'Maquina', a column date and a Column with the values i want to change. I also have the max for each machine and the max overall ('max refinaria') The first thing i want to do is see if the sum of the values, grouped by machine and by date is greater than the max for the machine. If it is, i want the difference to be pasted to the next day. I want this restrinction to be applied to the excel file and to allow the excel iterations to change the o ..read more
Visit website
TypeError: unhashable type: 'Series'
Python Forum » Data Science
by bongielondympofu
1M ago
I get the TypeError: unhashable type: 'Series' when running the code. The dataset does have a column called 'Date' The code is below import pandas as pd import matplotlib.pyplot as plt df = pd.read_csv("data.csv") date = input("What date would you like to view? (dd/mm/yyyy)\nEnter: ") df1 = df.loc(df["Date"] == date) print(df1) However the line below works; [df1 = (df.loc[df.Date == date])   dataset.png (Size: 8.66 KB / Downloads: 2 ..read more
Visit website

Follow Python Forum » Data Science on FeedSpot

Continue with Google
Continue with Apple
OR