Pandas는 데이터 분석, 조작 및 시각화를 위한 인기 있는 Python 라이브러리입니다. 구조화된 데이터와 구조화되지 않은 데이터를 포함하여 다양한 형식의 데이터를 쉽고 효과적으로 작업할 수 있는 풍부한 도구와 기능을 제공합니다. 이 문서에서는 Python에서 빠르고 효율적으로 데이터 분석을 수행하는 데 사용할 수 있는 일반적인 pandas 작업과 함수에 대한 치트시트를 제공합니다.
import pandas as pd
Pandas 라이브러리를 가져온 후에는 다음 작업과 함수를 사용하여 일반적인 데이터 분석 작업을 수행할 수 있습니다.
pd.read_csv(filename): CSV 파일에서 데이터를 로드합니다.
data.head(): 데이터 프레임의 처음 몇 행을 봅니다.
data.tail(): 데이터 프레임의 마지막 몇 행을 봅니다.
data.describe(): 숫자 열에 대한 요약 통계를 계산합니다.
data.info(): 데이터 프레임의 데이터 유형과 메모리 사용량을 확인합니다.
data.columns: 데이터 프레임의 열을 봅니다.
data['column']: 데이터 프레임의 열을 선택합니다.
data.loc[row_index]: 인덱스를 기준으로 데이터 프레임의 행을 선택합니다.
data.iloc[row_index]: 위치를 기준으로 데이터 프레임의 행을 선택합니다.
data.dropna(): 값이 누락된 행을 삭제합니다.
data.fillna(value): 누락된 값을 주어진 값으로 채웁니다.
data.rename(columns={'old': 'new'}): 데이터 프레임의 열 이름을 바꿉니다.
data.sort_values(by='column'): 열의 값을 기준으로 데이터 프레임을 정렬합니다.
data.groupby('column')['column'].mean(): 열의 값으로 데이터 프레임을 그룹화하고 다른 열의 평균을 계산합니다.
"""_summary_
얕은 복사(shallow copy)
list의 슬라이싱을 통한 새로운 값을 할당해봅니다.
아래의 결과와 같이 슬라이싱을 통해서 값을 할당하면 새로운 id가 부여되며, 서로 영향을 받지 않습니다
"""
print("\n","*" * 30, "\n 얕은 복사(shallow copy) \n","*" * 30)
a = [1, 2, 3]
b = a[:]
print(" a = ", a)
print(" b = ", b)
print(" id(a) : ", id(a)) #다른 주소
print(" id(b) : ", id(b))
print(" a == b : ", a == b)
print(" a is b : ", a is b)
b[0] = 5
print(a)
print(b)
"""
하지만, 이러한 슬라이싱 또한 얕은 복사에 해당합니다.
리스트안에 리스트 mutable객체 안에 mutable객체인 경우 문제가 됩니다.
id(a) 값과 id(b) 값은 다르게 되었지만, 그 내부의 객체 id(a[0])과 id(b[0])은 같은 주소를 바라보고 있습니다
"""
a = [[1,2],[3,4]]
b = a[:]
print(" id(a) : ", id(a)) #다른 주소
print(" id(b) : ", id(b))
print(" id(a[0]) : ",id(a[0])) #같은 주소
print(" id(b[0]) : ",id(b[0]))
"""깊은 복사(deep copy)
깊은 복사는 내부에 객체들까지 모두 새롭게 copy 되는 것입니다.
copy.deepcopy메소드가 해결해줍니다
"""
print("\n","*" * 30, "\n deepcopy \n","*" * 30)
import copy
a = [[1,2],[3,4]]
b = copy.deepcopy(a)
a[1].append(5)
print(" a : ", a)
print(" b : ", b)
print(" id(a) : ", id(a)) #다른 주소
print(" id(b) : ", id(b))
>>> x = {1, 2, 3}
>>> x
{1, 2, 3}
>>> id(x)
4396095304
>>> x|={4,5,6}
>>> x
{1, 2, 3, 4, 5, 6}
>>> id(x)
4396095304
str은 immutable 입니다.
s 변수에 첫번째 글자를 변경 시도하면 에러가 발생합니다.
s에 다른 값을 할당하면, id가 변경됩니다. 재할당은 애초에 변수를 다시할당하는 것이므로 mutable과 immutable과는 다른 문제입니다. list또한 값을 재할당하면 id가 변경됩니다.
>>> s= "abc"
>>> s
'abc'
>>> id(s)
4387454680
>>> s[0]
'a'
>>> s[0] = 's'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'str' object does not support item assignment
>>> s = 'def'
>>> s
'def'
>>> id(s)
4388970768
2. 변수 간 대입
2-1 mutable한 객체의 변수 간 대입
list의 얕은 복사를 확인 해봅니다.
b 에 a를 할당하면 값이 할당되는 것이 아니라 같은 메모리 주소를 바라봅니다.
b를 변경하면 같이 a도 바뀝니다.
mutable한 다른 객체 또한 똑같은 현상이 나타납니다.
>>> a = [1, 2, 3]
>>> b = a # shallow copy
>>> b[0]= 5
>>> a
[5, 2, 3]
>>> b
[5, 2, 3]
>>> id(a)
4396179528
>>> id(b)
4396179528
2-2 immutable한 객체의 변수간 대입
str 문자열의 얕은 복사를 확인해봅니다.
list와 똑같이 b를 a에 할당하면 같은 메모리 주소를 바라보게 됩니다.
하지만 b에 다른 값을 할당하면 재할당이 이루어지며 메모리 주소가 변경됩니다.
고로 a와 b는 다른 값을 가집니다.
>>> a = "abc"
>>> b = a
>>> a
'abc'
>>> b
'abc'
>>> id(a)
4387454680
>>> id(b)
4387454680
>>> b = "abcd"
>>> a
'abc'
>>> b
'abcd'
>>> id(a)
4387454680
>>> id(b)
4396456400
3. 얕은 복사(shallow copy)
list의 슬라이싱을 통한 새로운 값을 할당해봅니다.
아래의 결과와 같이 슬라이싱을 통해서 값을 할당하면 새로운 id가 부여되며, 서로 영향을 받지 않습니다.
>>> a = [1,2,3]
>>> b = a[:]
>>> id(a)
4396179528
>>> id(b)
4393788808
>>> a == b
True
>>> a is b
False
>>> b[0] = 5
>>> a
[1, 2, 3]
>>> b
[5, 2, 3]
하지만, 이러한 슬라이싱 또한 얕은 복사에 해당합니다.
리스트안에 리스트 mutable객체 안에 mutable객체인 경우 문제가 됩니다.
id(a)값과id(b)값은 다르게 되었지만, 그 내부의 객체id(a[0])과id(b[0])은 같은 주소를 바라보고 있습니다.
Whether you’re a seasoned developer or a curious beginner just starting, creating outstanding websites needs more than just stunning animations and interesting effects.
It all comes down to a solid basis in important concepts.
Mastering these bad boys will make you a more effective and flexible developer, ready to take on every task.
So grab your favorite coding cup (coffee for all-nighters, anyone?), and let’s get started!
Have aBIG IDEAin mind?Let’s discusswhat we can gain together.
Take these three to be the web’s basic building blocks.
HTML organizes your content, CSS beautifully styles it, and JavaScript adds interaction and personality.
Here is a basic breakdown:
HTML(Hypertext Markup Language) is the basis for your website, specifying elements such as headers, paragraphs, and illustrations.
CSS(Cascading Style Sheets): CSS makes your website visually attractive. CSS pseudo-classes can offer dynamic effects when a button is hovered over or focused, such as changing its color or adding stunning animations.
Actionable Tip: Use the BEM (Block-Element-Modifier) structure to write clean, maintainable CSS.
JavaScript: This is the magic that allows webpages to interact with one another. Learn how to write clean, maintainable JavaScript to avoid code challenges in the future.
02. Responsive Web Design
Imagine how your website looks on a large desktop display but not on a mobile device.
Not cool.
Responsive design guarantees that your website works effortlessly on any device, especially PCs, tablets, and smartphones.
Here is the secret sauce:
Media Queriesare like magic spells that tell your website to customize its layout depending on screen size.
Fluid Grids: Imagine a website layout as a grid. Fluid grids use percentages rather than set pixels, allowing the grid to “flow” and adjust to different displays.
Branches: Assume you want to test out a new feature without impacting the main code. Branches let you work on changes separately before merging them back into the main codebase once you’re satisfied.
The web is all about communication! HTTP (Hypertext Transfer Protocol) is the language that computers use to communicate with one another.
When you visit a website, your browser sends an HTTP request, and the server returns an HTTP response giving the website content.
HTTPS (Hypertext Transfer Protocol Secure)is the secure version of HTTP, which encrypts data transport to safeguard your website and user information. Always use HTTPS to ensure security!
APIs (Application Programming Interfaces)are similar to waiters at a restaurant. They accept your request (such as collecting user data) and deliver the information you want from another system. Understanding APIs is essential for creating interactive web apps.
05. Basic SEO:
Do you want your website to be the first thing visitors see when searching for something? Basic Search Engine Optimization (SEO) can help!
Meta Tags: These are hidden messages for search engines that include information about your website’s content.
Keywords: These are the terms that people are likely to look for. Use relevant keywords strategically throughout your website’s content.
Website Performance Optimization: A slow website is a sad one. Optimize your website’s image size and code structure for faster loading, which benefits both search engines and visitors.
06. Web Accessibility
The web should be accessible to everyone! Web accessibility means that persons with disabilities can get to and use your website.
Semantic HTMLmeans using HTML elements to explain the meaning and purpose of your content, instead of merely displaying it.
Keyboard Navigation: A mouse is not used by everyone. Ensure that your website can be accessed just by keyboard.
07. Performance Optimization
No one loves a slow website! Optimize your website’s speed by reducing HTTP requests (the number of times it asks the server for something), adding caching (storing frequently used items locally), and optimizing images for more quickly loading.
Remember that a quick website means a happy user (and a happy search engine!).
Pro Tips & Best Practices: From a Developer to You
Here are some gold pieces I’ve picked up along my journey.
Always comment on your code! Your future self (or someone else) will thank you.
TheProduct Hunt communityis buzzing about these incredible apps, and we’re here to tell you why!
Dive into the world of digital innovation with us as we showcase the elite selections from May’s latest findings.
Fromadvanced SaaSandproductivity boosterstogroundbreaking AI tools,essential remote work resources, and premium solutions fordevelopers,marketers,fintechaficionados, and even those in thedating scene— this list has it all.
If you’ve ever wished for a magic wand to bring your web dreams to life without all the technical fuss, then let’s talk aboutWegic.
Powered by the latest GPT-4o model, this web designer and developer is ready to turn your ideas into reality through simple conversations. Just share your vision, even if it’s rough around the edges, and Wegic will understand and bring it to life.
The app can create and modify websites in multiple languages, with custom domains, ensuring that your ideas are translated into a functional and beautiful page without hassle.
AI copilot for every marketing task Tags:Productivity, Marketing, Artificial Intelligence PH Launch: 02.05.2024 Upvotes: 1658 ▲
Shape the future of your marketing with adaptive strategies and role-based KPI alignment throughWaxwing
Every marketer needs to streamline efforts, save time, and cut costs. And maybe you’ve got the creativity and drive on the field, but need that extra push to become an AI-savvy marketer.Waxwingis that helping hand.
With just two minutes of onboarding, you can dive into detailed step-by-step plans complete with KPIs, impact assessments, effort estimates, and cost evaluations, backed up by a database of 500+ personalized marketing strategies.
Waxwing integrates with third-party tools like Similarweb and Semrush, as well as your internal tools, creating a central hub for all your business intelligence. Its context-aware AI acts as a copilot, always knowing what task you’re working on and providing the necessary guidelines to execute it effectively.
Turn any process into a step-by-step guide Tags:Productivity, Artificial Intelligence, Remote Work PH Launch: 15.05.2024 Upvotes: 1477 ▲
Onboard new employees, provide instructions to customers, or simply share knowledge with your team withGlitter AI
We’ve all been there: drowning in endless Zoom calls and struggling to explain processes to our co-workers or customers. Creating clear documentation takes too much time and we’re not always able to delegate that task.
But there’s an app that can completely change your workflow:Glitter AIturns your mouse clicks and voice into beautifully written guides complete with screenshots and text — pretty straightforward and incredibly effective!
The perk of the platform lies in its simplicity and efficiency. Just go through your process as you normally would and explain what you’re doing out loud. Glitter AI listens, takes screenshots, and turns everything into a polished guide you can easily edit and share.
No more starting over five times or dealing with the hassle of video tutorials — just speak, click, and share.
🪙 Pricing
Basic plan:Free(up to 10 guides, desktop + web capture, magic article: AI speech to text)
Pro plan:$16/month per member(unlimited guides, blur sensitive information, remove Glitter branding, export guides anywhere)
Team plan:$60/month(5 team members included, $12 / additional team member)
Speak toVoicenoteson your phone or computer or record from audiobooks and YouTube videos
Imagine this: You’re in the middle of a brainstorming session and ideas are flowing fast. Instead of scrambling to jot everything down or losing half your thoughts, you simply speak intoVoicenotesand see the magic happen.
The app captures every word you say and transcribes it accurately, even if there’s background noise or if you speak softly.
Later, when you need to revisit those notes, everything is neatly organized and searchable. This way, what could have been a chaotic mess of lost thoughts becomes a treasure trove of organized ideas, ready for you whenever you need them.
Over time, as you accumulate more notes, the AI helps you connect the dots, revealing insights you might have missed otherwise.
For those using the latest iPhone, setting Voicenotes as your action button is a game-changer, and for desktop users, keyboard shortcuts make recording a breeze.
🪙 Pricing
Note:Voicenotesis available on the web, iOS, Android,and soon on smartwatches — there’s no need to sign up to try it out for free.
Believer:$50/lifetime deal(limited launch offer, with limitless recording and the smartest AI models, GPT-4o and Claude Opus)
With an overwhelming number of platforms and influencers out there, there’s a simpler way to identify and engage with key influencers who can boost your brand’s visibility and credibility:Ivee.
This AI-powered B2B influencer marketing platform is designed to help you spot trendsetters, assess their audience quality, and engage with them at scale. You can easily identify the most relevant opinion leaders from LinkedIn, YouTube, Apple Podcasts, and Substack, with more platforms coming soon.
The app provides unique KPIs and data insights, such as engagement rates, performance trends, and sponsorship history, so you can accurately assess the quality of an influencer’s audience.
Plus, you can create custom influencer databases tailored to your specific needs — by topics, projects, channels, subscriber sizes, and more — so that using Ivee is straightforward and highly effective.
Instantly search through all your folders, apps, and accounts MeetCuriosity,the ultimate all-in-one search tool, command bar and AI Assistant 🔎
Curiosity: connect all your apps and inboxes for search, chat with your files, and autoreply any message
Curiosityis the one search bar for all your work. It connects with all your emails, calendars, local folders, cloud drives, and tools like Notion, Slack, pCloud, and HubSpot to give you one integrated search! That saves time and helps you stay in the flow.
Curiosityalso gives you a shortcut to instantly launch programs, join meetings, open folders, and search your clipboard history.
And it gets even better: With theAI Assistant,Curiosityputs the power of ChatGPT at your fingertips. You can use it to summarize or translate documents, auto-reply to emails, and ask questions about your files.
No need to waste time jumping from one app to another when you can have everything you need in one place, right?
🪙 Pricing
Starter plan:Free(connect up to 5 apps, search across apps and folders, launch apps and meetings, AI assistant)
Pro plan:€8/month(connect unlimited apps, advanced AI assistant, deep file search, unlimited clipboard history)
Workspaces plan:€10/month per user(5+ users, shared search across sources, user management and central billing, 50GB+ cloud storage)
Save valuable time withFynk, a powerful contract management software
Fynkis an all-in-one solution that makes contract management a breeze. Built with powerful AI, this app seamlessly imports, creates, automates, manages, collaborates on, and signs contracts — all in one platform!
Whether you’re bulk importing existing contracts or creating new ones from templates, Fynk’s smart AI analyzes and summarizes your contracts, extracting key information like renewal dates and parties involved.
The app includes a custom contract editor with dynamic fields, digital signatures (SES, AES & QES), and automation workflows.
Plus, Fynk supports approval workflows, negotiation and collaboration features, along with reminders and notifications to keep you on track.
And if you’re starting from scratch, the app’s public templates and in-editor AI will guide you through drafting a contract in no time.
🪙 Pricing
Essential plan:$69/month(50 tracked documents, 2 users, SES signatures, AES signatures, QES signatures, AI contract analysis, AI contract summary)
The first copilot for technical design Tags:Software Engineering, Developer Tools, Artificial Intelligence PH Launch: 15.05.2024 Upvotes: 1137 ▲
Write natural language prompts to output diagram code and share them withEraser AI
Launched to help you create and edit diagrams and documents with ease,Eraser AIis the tool that will take the tedious parts of technical design off your plate, so you can focus on the more important aspects of your projects.
Simply type out your ideas in natural language, and the app generates a beautiful, colorful, icon-studded diagram in seconds. You can easily tweak it to perfection and quickly generate an outline for your design doc. Choose from four different diagram types and even include images in your prompts if you’d like, with full control over editing.
You can quickly create outlines for planning documents (like RFCs and design docs) or documentation (such as READMEs), and use additional AI prompts for open-ended or tedious tasks.
🪙 Pricing
Free Plan:Free(5 files, 20 AI diagrams, 7-day version history, unlimited guests, diagram-as-code, Github integration, Notion integration)
Professional Plan:$10/month per member(unlimited files, AI diagrams, and guests, 90-day version history, PDF exports, private files, publicly editable files)
All AIs in one platform for team collaboration Tags:Productivity, Artificial Intelligence, Bots PH Launch: 13.05.2024 Upvotes: 1122 ▲
Streamline your workflow, improve decision-making, and cut costs withBoodleBox
Have you ever found your team under pressure to deliver a comprehensive market analysis report, but the data was scattered across different sources and tools? Instead of wasting time jumping between platforms and struggling to integrate various AI tools, you can now turn toBoodleBox.
This all-in-one AI collaboration platform is designed to make teamwork with GenAI simpler, faster, and more efficient.
BoodleBox brings together the top AI models — ChatGPT, Claude, Gemini, Llama, Perplexity, DALLE, SDXL — and over 1,000 custom GPT bots, so that you can enhance your workflow by allowing multi-bot chats and personalizing responses with custom knowledge.
🪙 Pricing
Basic plan:Free(2,500 words/month, over 1,000 AI bots, up to 2 boxes)
The investment platform for couples Tags:Fintech, Dating, Investing PH Launch: 16.05.2024 Upvotes: 1036 ▲
Prepare for a brighter future next to your loved one withPlenty
Are you and your partner trying to figure out how to invest and plan for your future in the best way possible?Plentyaims to transform your financial journey with tools and resources that promote teamwork, shared responsibility, and smarter investment decisions — so you can grow your wealth together.
Unlike traditional financial services that often cater to individuals or require hefty fees and minimums, this platform offers accessible and advanced investment strategies and financial products to everyday households.
With a high-yield savings account offering 5.08% APY for your cash, a low 0.20% annual investing fee, and advanced direct indexing portfolios, you get access to financial tools that were once reserved for the wealthy.
The platform is built on the concept of managing money in a “Yours/Mine/Ours” approach, making it easy to balance shared and individual financial goals.
🪙 Pricing
Membership plan:$8.33/month per person(5.08% current APY for savings, $500k SIPC insurance per account, 2–4% higher after-tax returns)
Build a product that resonates with your audience withInsighto
If you’ve ever wished for a simple, cost-effective way to truly understand what your users want, say hello toInsighto: a platform designed to help you collect valuable feedback, prioritize features, and build a product that your users will love!
Unlike Canny and similar tools, Insighto is pretty straightforward and focused on what truly matters. You can easily collect feedback from your customers, prioritize these insights, and make informed decisions about which features to develop next — without being overwhelmed by unnecessary features.
Best of all, it’s completely free, making it accessible for startups and small teams who need to manage their budgets carefully.