Skip to content
Advertisement

Tag: dataframe

I’m trying to create a table from text

I want to create a table with two columns separated by “:”. So the capitalized words as the first column and everything after the “:” as the second column. I was originally tried to do this from a PDF but that wasn’t working so I copied it to a text file thinking it might be easier that way. I’m very

How to delete duplicates pandas

I need to check if there are some duplicates value in one column of a dataframe using Pandas and, if there is any duplicate, delete the entire row. I need to check just the first column. Example: What i need is: I can delete the ‘object’ duplicates with the following code, but I can’t delete the entire row that contains

pandas change dataset value of a specific row using loc

I’m new to programming, I’m working on a python project using pandas I wanted to change values of each row of a dataset using .loc, but it seems like it won’t work, the idea is to make a row take EOL value if the row is equal to 0, the code doesn’t bring an error, but my dataset is unchanged

PySpark Incremental Count on Condition

Given a Spark dataframe with the following columns I am trying to construct an incremental/running count for each id based on when the contents of the event column evaluate to True. Here a new column called results would be created that contained the incremental count. I’ve tried using window functions but am stumped at this point. Ideally, the solution would

Advertisement