<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Zeeshan Ali on Medium]]></title>
        <description><![CDATA[Stories by Zeeshan Ali on Medium]]></description>
        <link>https://medium.com/@zeebrockeraa?source=rss-88b93a4618e8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NKXPyetSN51um0OrfAvzOw.jpeg</url>
            <title>Stories by Zeeshan Ali on Medium</title>
            <link>https://medium.com/@zeebrockeraa?source=rss-88b93a4618e8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 05:37:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zeebrockeraa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Python Dataframe Filter Rows by Condition]]></title>
            <link>https://medium.com/@zeebrockeraa/python-dataframe-filter-rows-by-condition-8998ae37a392?source=rss-88b93a4618e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8998ae37a392</guid>
            <category><![CDATA[python-data-science]]></category>
            <category><![CDATA[dataframes-python]]></category>
            <category><![CDATA[filter-rows-by-condition]]></category>
            <category><![CDATA[dataframe-filter-python]]></category>
            <dc:creator><![CDATA[Zeeshan Ali]]></dc:creator>
            <pubDate>Fri, 21 Jul 2023 22:45:04 GMT</pubDate>
            <atom:updated>2023-07-21T22:45:04.203Z</atom:updated>
            <content:encoded><![CDATA[<p>To filter rows in a pandas DataFrame based on a condition, you can use boolean indexing. Here’s an example of how to do it:</p><p>Suppose you have a DataFrame named df with columns &#39;Column1&#39;, &#39;Column2&#39;, and &#39;Column3&#39;, and you want to filter the rows where the values in &#39;Column2&#39; are greater than 50. Here&#39;s how you can do it:</p><pre>import pandas as pd</pre><pre># Sample DataFrame<br>data = {<br>    &#39;Column1&#39;: [1, 2, 3, 4, 5],<br>    &#39;Column2&#39;: [30, 60, 40, 70, 80],<br>    &#39;Column3&#39;: [&#39;A&#39;, &#39;B&#39;, &#39;C&#39;, &#39;D&#39;, &#39;E&#39;]<br>}</pre><pre>df = pd.DataFrame(data)</pre><pre># Filter rows where &#39;Column2&#39; is greater than 50<br>filtered_df = df[df[&#39;Column2&#39;] &gt; 50]</pre><pre>print(filtered_df)</pre><p>Output:</p><pre>Column1  Column2 Column3<br>1        2       60       B<br>3        4       70       D<br>4        5       80       E</pre><p>The resulting DataFrame filtered_df contains only the rows where the value in &#39;Column2&#39; is greater than 50.</p><p>Make sure you have pandas installed (pip install pandas) if you haven&#39;t already. You can run this command in your terminal.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8998ae37a392" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Dataframe Filter by Column Value]]></title>
            <link>https://medium.com/@zeebrockeraa/python-dataframe-filter-by-column-value-9eefba9ee12e?source=rss-88b93a4618e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9eefba9ee12e</guid>
            <category><![CDATA[column-value]]></category>
            <category><![CDATA[dataframes-python]]></category>
            <category><![CDATA[dataframe-filter-python]]></category>
            <category><![CDATA[python-data-science]]></category>
            <dc:creator><![CDATA[Zeeshan Ali]]></dc:creator>
            <pubDate>Fri, 21 Jul 2023 22:41:54 GMT</pubDate>
            <atom:updated>2023-07-21T22:41:54.360Z</atom:updated>
            <content:encoded><![CDATA[<p>To filter a DataFrame by a specific column value in Python using pandas, you can follow these steps:</p><ol><li>Import the necessary libraries.</li><li>Create your DataFrame.</li><li>Use the loc or query method to filter the DataFrame based on the desired column value.</li></ol><p>Here’s an example of how to do it:</p><pre>import pandas as pd</pre><pre># Step 2: Create your DataFrame<br>data = {<br>    &#39;Name&#39;: [&#39;Alice&#39;, &#39;Bob&#39;, &#39;Charlie&#39;, &#39;David&#39;, &#39;Emily&#39;],<br>    &#39;Age&#39;: [25, 30, 22, 35, 28],<br>    &#39;City&#39;: [&#39;New York&#39;, &#39;San Francisco&#39;, &#39;Los Angeles&#39;, &#39;Chicago&#39;, &#39;Boston&#39;]<br>}</pre><pre>df = pd.DataFrame(data)</pre><pre># Step 3: Filter the DataFrame by the &#39;City&#39; column value<br>city_to_filter = &#39;New York&#39;<br>filtered_df = df[df[&#39;City&#39;] == city_to_filter]</pre><pre># You can also use the query method to filter the DataFrame<br># filtered_df = df.query(&quot;City == @city_to_filter&quot;)</pre><pre>print(&quot;Original DataFrame:&quot;)<br>print(df)</pre><pre>print(&quot;\nFiltered DataFrame:&quot;)<br>print(filtered_df)</pre><p>Output:</p><pre>Original DataFrame:<br>       Name  Age           City<br>0     Alice   25       New York<br>1       Bob   30  San Francisco<br>2  Charlie   22    Los Angeles<br>3     David   35        Chicago<br>4     Emily   28         Boston</pre><pre>Filtered DataFrame:<br>    Name  Age      City<br>0  Alice   25  New York</pre><p>In this example, we filtered the DataFrame to include only the rows where the ‘City’ column has the value ‘New York’. You can replace &#39;New York&#39; with any other city value you want to filter by.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9eefba9ee12e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Dataframe Filter and Matplotlib Implementation]]></title>
            <link>https://medium.com/@zeebrockeraa/python-dataframe-filter-implementation-94c556398d57?source=rss-88b93a4618e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/94c556398d57</guid>
            <category><![CDATA[python-data-science]]></category>
            <category><![CDATA[dataframes-python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[dataframe-filter-python]]></category>
            <dc:creator><![CDATA[Zeeshan Ali]]></dc:creator>
            <pubDate>Fri, 21 Jul 2023 22:38:40 GMT</pubDate>
            <atom:updated>2023-07-21T22:39:30.996Z</atom:updated>
            <content:encoded><![CDATA[<p>I understand you want to filter a Python DataFrame and use it in further operations. To do that, you can use the popular library called pandas, which provides powerful tools for data manipulation and analysis.</p><p>Assuming you already have pandas installed, here’s a step-by-step guide on how to filter a DataFrame and then perform some operations on the filtered data:</p><p>Step 1: Import the necessary libraries</p><pre>import pandas as pd</pre><p>Step 2: Create a DataFrame For demonstration purposes, let’s create a simple DataFrame containing some sample data:</p><pre>data = {<br>    &#39;Name&#39;: [&#39;Alice&#39;, &#39;Bob&#39;, &#39;Charlie&#39;, &#39;David&#39;, &#39;Eva&#39;],<br>    &#39;Age&#39;: [25, 30, 22, 27, 29],<br>    &#39;City&#39;: [&#39;New York&#39;, &#39;San Francisco&#39;, &#39;Los Angeles&#39;, &#39;Chicago&#39;, &#39;Miami&#39;]<br>}</pre><pre>df = pd.DataFrame(data)</pre><p>Your DataFrame df will look like this:</p><pre>Name  Age           City<br>0    Alice   25       New York<br>1      Bob   30  San Francisco<br>2  Charlie   22    Los Angeles<br>3    David   27        Chicago<br>4      Eva   29          Miami</pre><p>Step 3: Filter the DataFrame Now let’s say you want to filter the DataFrame to only include people who are older than or equal to 25 years old:</p><pre>filtered_df = df[df[&#39;Age&#39;] &gt;= 25]</pre><p>The filtered_df will now contain only the rows that meet the condition:</p><pre>Name  Age           City<br>0  Alice   25       New York<br>1    Bob   30  San Francisco<br>3  David   27        Chicago<br>4    Eva   29          Miami</pre><p>Step 4: Perform operations on the filtered DataFrame Now that you have the filtered DataFrame, you can perform various operations on it, such as calculating statistics or plotting the data:</p><pre># Calculate the average age of the filtered individuals<br>average_age = filtered_df[&#39;Age&#39;].mean()<br>print(&quot;Average age:&quot;, average_age)</pre><pre># Plot a bar chart showing the number of people in each city<br>import matplotlib.pyplot as plt</pre><pre>city_counts = filtered_df[&#39;City&#39;].value_counts()<br>city_counts.plot(kind=&#39;bar&#39;)<br>plt.xlabel(&#39;City&#39;)<br>plt.ylabel(&#39;Number of People&#39;)<br>plt.title(&#39;Number of People in Each City&#39;)<br>plt.show()</pre><p>Remember to adjust the operations based on your specific use case. Filtering the DataFrame allows you to work with a subset of data that meets your criteria, which can be extremely useful in data analysis and manipulation tasks.</p><p>Command to import matplotlib</p><p><strong>pip install matplotlib</strong></p><p>Run it in your terminal.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94c556398d57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Convert Python Dataframe to Dictionary]]></title>
            <link>https://medium.com/@zeebrockeraa/convert-python-dataframe-to-dictionary-809d4277c8b7?source=rss-88b93a4618e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/809d4277c8b7</guid>
            <category><![CDATA[dataframe-to-dictionary]]></category>
            <category><![CDATA[dataframes-python]]></category>
            <category><![CDATA[dictionary-in-python]]></category>
            <category><![CDATA[python-dictionaries]]></category>
            <category><![CDATA[convert-python-dataframe]]></category>
            <dc:creator><![CDATA[Zeeshan Ali]]></dc:creator>
            <pubDate>Wed, 19 Jul 2023 20:51:26 GMT</pubDate>
            <atom:updated>2023-07-19T20:51:26.496Z</atom:updated>
            <content:encoded><![CDATA[<p>Converting a Python DataFrame to a dictionary is a common operation in data manipulation. You can achieve this using the pandas library in Python. Here’s how you can do it:</p><pre>import pandas as pd<br><br># Sample data for the DataFrame<br>data = {<br>    &#39;Name&#39;: [&#39;Amy&#39;, &#39;John&#39;, &#39;Sara&#39;],<br>    &#39;Age&#39;: [25, 30, 28],<br>    &#39;Gender&#39;: [&#39;Female&#39;, &#39;Male&#39;, &#39;Female&#39;]<br>}<br><br># Creating the DataFrame<br>df = pd.DataFrame(data)<br><br># Convert the DataFrame to a dictionary<br>data_dict = df.to_dict(orient=&#39;list&#39;)<br><br># The resulting dictionary will look like this:<br># {<br>#    &#39;Name&#39;: [&#39;Amy&#39;, &#39;John&#39;, &#39;Sara&#39;],<br>#    &#39;Age&#39;: [25, 30, 28],<br>#    &#39;Gender&#39;: [&#39;Female&#39;, &#39;Male&#39;, &#39;Female&#39;]<br># }</pre><p>In this example, the orient=&#39;list&#39; parameter specifies that the resulting <a href="https://letmeflutter.com/category/python-programming/python-dictionaries/"><strong>dictionary</strong></a> should have the values as lists, where each list corresponds to a column from the DataFrame.</p><p>Now, you have successfully converted your DataFrame to a dictionary in Python.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=809d4277c8b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Dataframe to CSV File Generation]]></title>
            <link>https://medium.com/@zeebrockeraa/python-dataframe-to-csv-file-generation-c575feab274c?source=rss-88b93a4618e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/c575feab274c</guid>
            <category><![CDATA[dataframe-to-csv-file]]></category>
            <category><![CDATA[dataframe-to-csv-python]]></category>
            <category><![CDATA[dataframes-python]]></category>
            <category><![CDATA[python-csv-file]]></category>
            <category><![CDATA[python-csv-file-creation]]></category>
            <dc:creator><![CDATA[Zeeshan Ali]]></dc:creator>
            <pubDate>Wed, 19 Jul 2023 20:47:05 GMT</pubDate>
            <atom:updated>2023-07-19T20:47:05.133Z</atom:updated>
            <content:encoded><![CDATA[<p>To save a Python DataFrame to a CSV (Comma-Separated Values) file, you can use the to_csv() method provided by pandas library, assuming you have pandas installed. Here&#39;s how you can do it:</p><p>pip install pandas</p><p>In case you don’t have pandas installed in your system, then run this command in your terminal or cmd.</p><pre>import pandas as pd<br><br># Creating a dictionary that represents the data<br>data = {<br>    &#39;Name&#39;: [&#39;Alice&#39;, &#39;Bob&#39;, &#39;Charlie&#39;, &#39;David&#39;],<br>    &#39;Age&#39;: [25, 30, 22, 28],<br>    &#39;City&#39;: [&#39;New York&#39;, &#39;San Francisco&#39;, &#39;Los Angeles&#39;, &#39;Chicago&#39;],<br>    &#39;Salary&#39;: [50000, 60000, 45000, 55000]<br>}<br><br># Creating the DataFrame<br>df = pd.DataFrame(data)<br><br># If you want to save the DataFrame to a CSV file without including the index:<br>df.to_csv(&#39;output.csv&#39;, index=False)<br><br># If you want to save the DataFrame to a CSV file and include the index:<br>df.to_csv(&#39;output.csv&#39;, index=True)</pre><p>In the above code, df is the name of your DataFrame, and we are using the to_csv() method to save it to a file named &quot;output.csv&quot;. The index parameter is used to specify whether you want to include the row index in the CSV file. Setting index=False will exclude the index, while index=True (which is the default) will include it.</p><p>Make sure you have pandas installed before running the code. If you don’t have it installed, you can install it using pip:</p><pre>pip install pandas</pre><p>Once you run the code, your DataFrame will be saved as a CSV file named “output.csv” in the current working directory.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c575feab274c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Dataframe to Excel File Generation]]></title>
            <link>https://medium.com/@zeebrockeraa/python-dataframe-to-excel-file-generation-28748155abde?source=rss-88b93a4618e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/28748155abde</guid>
            <category><![CDATA[dataframe-to-excel]]></category>
            <category><![CDATA[python-dataframe-to-excel]]></category>
            <category><![CDATA[dataframes-python]]></category>
            <category><![CDATA[convert-dataframe-excel]]></category>
            <category><![CDATA[create-excel-in-python]]></category>
            <dc:creator><![CDATA[Zeeshan Ali]]></dc:creator>
            <pubDate>Wed, 19 Jul 2023 20:40:57 GMT</pubDate>
            <atom:updated>2023-07-19T20:40:57.517Z</atom:updated>
            <content:encoded><![CDATA[<p>Export a Python DataFrame to an Excel file using the popular library called Pandas. Make sure you have Pandas installed before proceeding. The ‘openpyxl’ module, which is required to work with Excel files. If you don’t have them, you can install them using pip:</p><pre>pip install pandas<br>pip install openpyxl</pre><p>Here’s a step-by-step guide on how to do it:</p><p>Step 1: Import the necessary libraries</p><pre>import pandas as pd</pre><p>Step 2: Create a DataFrame (If you already have one, you can skip this step)</p><pre># Example DataFrame<br>data = {<br>    &#39;Name&#39;: [&#39;John&#39;, &#39;Jane&#39;, &#39;Sara&#39;],<br>    &#39;Age&#39;: [25, 30, 22],<br>    &#39;Occupation&#39;: [&#39;Engineer&#39;, &#39;Doctor&#39;, &#39;Teacher&#39;]<br>}</pre><pre>df = pd.DataFrame(data)</pre><p>Step 3: Export the DataFrame to Excel</p><pre># Specify the file name for the Excel file<br>file_name = &#39;dataframe_data.xlsx&#39;</pre><pre># Export the DataFrame to Excel<br>df.to_excel(file_name, index=False)  <br># Set index=False to avoid saving the index column or make it True<br>#if you want to add it </pre><p>That’s it! Now you should have an Excel file named ‘dataframe_data.xlsx’ in your current working directory containing the data from your DataFrame.</p><p>Remember that the above code assumes you have already created a DataFrame named df. If you have a different DataFrame, you can use the same to_excel() method to export it to Excel with the specified file name.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28748155abde" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Convert Python List of Dataframes to JSON]]></title>
            <link>https://medium.com/@zeebrockeraa/convert-python-list-of-dataframes-to-json-91da8cc37bd7?source=rss-88b93a4618e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/91da8cc37bd7</guid>
            <category><![CDATA[python-json]]></category>
            <category><![CDATA[dataframes-to-json]]></category>
            <category><![CDATA[python-list-of-dataframes]]></category>
            <category><![CDATA[list-of-dataframe-to-json]]></category>
            <category><![CDATA[dataframes-python]]></category>
            <dc:creator><![CDATA[Zeeshan Ali]]></dc:creator>
            <pubDate>Mon, 17 Jul 2023 21:04:17 GMT</pubDate>
            <atom:updated>2023-07-17T21:04:17.859Z</atom:updated>
            <content:encoded><![CDATA[<p>To convert a Python list of DataFrames to JSON format, you can follow these steps:</p><ol><li>Import the necessary libraries:</li></ol><pre>import pandas as pd<br>import json</pre><ol><li>Create a Python list containing your DataFrames:</li></ol><pre># DataFrame 1<br>df1 = pd.DataFrame({&#39;Name&#39;: [&#39;John&#39;, &#39;Alice&#39;, &#39;Bob&#39;],<br>                    &#39;Age&#39;: [25, 32, 28],<br>                    &#39;City&#39;: [&#39;New York&#39;, &#39;London&#39;, &#39;Paris&#39;]})<br><br># DataFrame 2<br>df2 = pd.DataFrame({&#39;Product&#39;: [&#39;Apple&#39;, &#39;Banana&#39;, &#39;Orange&#39;],<br>                    &#39;Price&#39;: [1.25, 0.75, 0.99],<br>                    &#39;Quantity&#39;: [10, 15, 8]})<br><br># DataFrame 3<br>df3 = pd.DataFrame({&#39;Country&#39;: [&#39;USA&#39;, &#39;Canada&#39;, &#39;Australia&#39;],<br>                    &#39;Population&#39;: [328.2, 37.6, 25.0],<br>                    &#39;Area&#39;: [9.83, 9.98, 7.68]})<br><br><br>dataframes_list = [df1, df2, df3]  # Replace df1, df2, df3 with your actual DataFrames</pre><ol><li>Create an empty list to store the JSON representations of each DataFrame:</li></ol><pre>json_list = []</pre><ol><li>Iterate over the DataFrames in the list and convert each DataFrame to JSON format using the to_json() function from the Pandas library:</li></ol><pre>for df in dataframes_list:<br>    json_data = df.to_json(orient=&#39;records&#39;)<br>    json_list.append(json.loads(json_data))</pre><ol><li>Finally, you can convert the json_list to a JSON string using the json.dumps() function:</li></ol><pre>json_string = json.dumps(json_list)</pre><p>The json_string variable will contain the JSON representation of your list of DataFrames.</p><p>Note: Keep in mind that this conversion will include the data and structure of the DataFrames, but any DataFrame-specific functionality or operations will not be preserved in the resulting JSON format.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91da8cc37bd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Convert Python Dataframe to List]]></title>
            <link>https://medium.com/@zeebrockeraa/convert-python-dataframe-to-list-3ec1d82e0bd8?source=rss-88b93a4618e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ec1d82e0bd8</guid>
            <category><![CDATA[dataframes-python]]></category>
            <category><![CDATA[convert-python-dataframe]]></category>
            <category><![CDATA[python-list-to-dataframe]]></category>
            <category><![CDATA[python-list]]></category>
            <dc:creator><![CDATA[Zeeshan Ali]]></dc:creator>
            <pubDate>Mon, 17 Jul 2023 20:59:37 GMT</pubDate>
            <atom:updated>2023-07-17T20:59:37.057Z</atom:updated>
            <content:encoded><![CDATA[<p>To convert a DataFrame to a list in Python, you can use the values attribute of the DataFrame, which returns a NumPy array, and then convert it to a list using the tolist() method. Here&#39;s an example:</p><pre>import pandas as pd</pre><pre># Create a sample DataFrame<br>df = pd.DataFrame({&#39;A&#39;: [1, 2, 3], &#39;B&#39;: [4, 5, 6], &#39;C&#39;: [7, 8, 9]})</pre><pre># Convert DataFrame to a list<br>df_list = df.values.tolist()</pre><pre>print(df_list)</pre><p>Output:</p><pre>[[1, 4, 7], [2, 5, 8], [3, 6, 9]]</pre><p>In this example, the DataFrame has three columns (‘A’, ‘B’, and ‘C’) and three rows. The df.values attribute returns a NumPy array, which is then converted to a list using the tolist() method. The resulting list df_list contains each row of the DataFrame as a separate list within it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ec1d82e0bd8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python convert Json List to Dataframe]]></title>
            <link>https://medium.com/@zeebrockeraa/python-convert-json-list-to-dataframe-15226bde3ff6?source=rss-88b93a4618e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/15226bde3ff6</guid>
            <category><![CDATA[python-list]]></category>
            <category><![CDATA[json-list-to-dataframe]]></category>
            <category><![CDATA[python-json-list]]></category>
            <category><![CDATA[python-json-list-convert]]></category>
            <category><![CDATA[dataframes-python]]></category>
            <dc:creator><![CDATA[Zeeshan Ali]]></dc:creator>
            <pubDate>Mon, 17 Jul 2023 20:58:06 GMT</pubDate>
            <atom:updated>2023-07-17T20:58:06.450Z</atom:updated>
            <content:encoded><![CDATA[<p>To convert a JSON list to a DataFrame in Python, you can use the pandas library. Here&#39;s an example of how you can do it:</p><pre>import pandas as pd<br>import json</pre><pre># Assuming you have a JSON list stored in a variable called json_list<br># If your JSON is stored in a file, you can use json.load() instead of json.loads()<br>json_list = &#39;[{&quot;name&quot;: &quot;John&quot;, &quot;age&quot;: 30}, {&quot;name&quot;: &quot;Jane&quot;, &quot;age&quot;: 25}]&#39;</pre><pre># Convert the JSON list to a Python list of dictionaries<br>data = json.loads(json_list)</pre><pre># Convert the Python list to a DataFrame<br>df = pd.DataFrame(data)</pre><pre># Print the DataFrame<br>print(df)</pre><p>In this example, the JSON list contains two objects, each representing a person’s name and age. The json.loads() function is used to parse the JSON list and convert it into a Python list of dictionaries. Then, the pd.DataFrame() function from the pandas library is used to convert the Python list into a DataFrame. Finally, the DataFrame is printed to the console.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15226bde3ff6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Join List to Dataframe]]></title>
            <link>https://medium.com/@zeebrockeraa/python-join-list-to-dataframe-8a5f305c5378?source=rss-88b93a4618e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a5f305c5378</guid>
            <category><![CDATA[join-list-to-dataframe]]></category>
            <category><![CDATA[dataframes-python]]></category>
            <category><![CDATA[python-list]]></category>
            <category><![CDATA[python-list-to-dataframe]]></category>
            <category><![CDATA[python-join-list]]></category>
            <dc:creator><![CDATA[Zeeshan Ali]]></dc:creator>
            <pubDate>Mon, 17 Jul 2023 20:56:08 GMT</pubDate>
            <atom:updated>2023-07-17T20:56:08.974Z</atom:updated>
            <content:encoded><![CDATA[<p>To join a list into a DataFrame in Python, you can use the pandas library. Here’s an example:</p><pre>import pandas as pd</pre><pre>my_list = [&#39;apple&#39;, &#39;banana&#39;, &#39;cherry&#39;]</pre><pre>df = pd.DataFrame({&#39;fruits&#39;: my_list})<br>print(df)</pre><p>This code creates a DataFrame with a single column named ‘fruits’ and populates it with the elements from the my_list variable. The output will be:</p><pre>fruits<br>0   apple<br>1  banana<br>2  cherry</pre><p>You can customize the column name by changing &#39;fruits&#39; in the pd.DataFrame() function to a different name.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a5f305c5378" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>