Comments (2)
Hi,
Thanks! :-)
So, regarding the filtering, you can use Spark's own expr
function to easily come up with expressions that will return the filter criteria. For instance, if you would like to get only rows where Age
is greater than 25:
from pyspark.sql import functions as F
sdf.filter(F.expr('Age > 25'))
There is no need to create a column, Spark will evaluate the expression and filter it accordingly.
But if you want to do something fancier, you can leverage the pandas
object of HandySpark as well. Let's say you want to filter only for a list of specific values:
hdf.filter(hdf.pandas['Age'].isin(values=[25, 26]))
HandySpark implements several column methods available in Pandas, like isin
.
from handyspark.
Great Thanks, that worked, good to know I can filter within Handy.
from handyspark.
Related Issues (20)
- SyntaxError: only named arguments may follow *expression when use python2 HOT 1
- how to get get bins and counts instead of a plot HOT 5
- How to compute the median value of a column HOT 1
- koalas vs handyspark HOT 2
- need to have inline plots visuals on zeppelin ..
- Error: only named arguments may follow *expression HOT 1
- Boxplot X label rotation HOT 1
- remove pyspark dependency
- When column is of type int, histogram acts different from pandas dataframe
- pyqt4 error
- Request Python2.6.6 version HOT 1
- Confusion martrix not working with DataBricks 7.4 ML level of spark HOT 1
- boxplot is failing HOT 1
- tukey outliers fails
- Use of Mahalanobis distance for outlier detection
- 'HandyGrouped' object has no attribute 'session' HOT 2
- getMetricsByThreshold is failing HOT 1
- Request for new feature: Quantile based discretization: pandas.qcut() HOT 1
- Options for hist() plot HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from handyspark.