I want to do something like sort uniq in Python

Befor.py


previousHoge = ""
    for hoge in HogeList :
        if (hoge != previousHoge):
            print hoge
        previousHoge = hoge

After.py


sorted(set(HogeList), key= HogeList)

Recommended Posts

I want to do something like sort uniq in Python
I want to do something in Python when I finish
I want to do Dunnett's test in Python
I wanted to do something like an Elixir pipe in Python
I want to manipulate strings in Kotlin like Python!
I want to improve efficiency with Python even in an experimental system (3) I want to do something like Excel with Pandas
Do something like Redis transactions in Python
I want to create a window in Python
I want to merge nested dicts in Python
I tried to implement selection sort in python
I want to display the progress in Python!
I want to do a monkey patch only partially safely in Python
I want to write in Python! (1) Code format check
I want to embed a variable in a Python string
I want to easily implement a timeout in python
I want to write in Python! (2) Let's write a test
Even in JavaScript, I want to see Python `range ()`!
I want to randomly sample a file in Python
I want to work with a robot in python.
I want to write in Python! (3) Utilize the mock
[ML Ops] I want to do multi-project with Python
I want to use the R dataset in python
Something like JS setTimeout in python
Do something like a Python interpreter in Visual Studio Code
I want to do ○○ with Pandas
I want to be able to run Python in VS Code
I want to debug with Python
I want to make input () a nice complement in python
Something like tail -f in Python
Do you want to wait for general purpose in Python Selenium?
I want to do a full text search with elasticsearch + python
[Python / AWS Lambda layers] I want to reuse only module in AWS Lambda Layers
[Machine learning] I tried to do something like passing an image
I tried to implement PLSA in Python
I tried to implement permutation in Python
I want to print in a comprehension
How to do R chartr () in Python
I tried to implement PLSA in Python 2
I want to use jar from python
I want to build a Python environment
I want to analyze logs with Python
I want to play with aws with python
I tried to implement ADALINE in Python
I wanted to solve ABC159 in Python
I tried to implement PPO in Python
I want to embed Matplotlib in PySimpleGUI
Try something like Python for-else in Ruby
#I tried something like Vlookup with Python # 2
I want to convert a table converted to PDF in Python back to CSV
I want to batch convert the result of "string" .split () in Python
I want to explain the abstract class (ABCmeta) of Python in detail.
I want to sort a list in the order of other lists
Environment maintenance made with Docker (I want to post-process GrADS in Python
I want to color a part of an Excel string in Python
Q. Do you want to do something like generics that takes value from []?
After all, what should I use to do type comparisons in Python?
I want to use MATLAB feval with python
I want to pin Datetime.now in Django tests
I want to memoize including Python keyword arguments
[Python] What I did to do Unit Test
I was able to recurse in Python: lambda