use product
from itertools
:
>>> from itertools import product
>>> pd.DataFrame(list(product(l1, l2)), columns=['l1', 'l2'])
l1 l2
0 A 1
1 A 2
2 B 1
3 B 2
More Related Contents:
- Why does concatenation of DataFrames get exponentially slower?
- Combine Date and Time columns using python pandas
- Pandas: How to easily share a sample dataframe using df.to_dict()?
- Pandas/Python: Set value of one column based on value in another column
- Accessing Pandas column using squared brackets vs using a dot (like an attribute)
- Pandas: Get Dummies
- Get the name of a pandas DataFrame
- how to get ticks every hour?
- Calculate weighted average using a pandas/dataframe
- How to add value labels on a bar chart
- How to remove blanks/NA’s from dataframe and shift the values up
- Comparing previous row values in Pandas DataFrame
- What is the difference between join and merge in Pandas?
- Ambiguity in Pandas Dataframe / Numpy Array “axis” definition
- Difference(s) between merge() and concat() in pandas
- Counting unique values in a column in pandas dataframe like in Qlik?
- Pandas – dataframe groupby – how to get sum of multiple columns
- “Series objects are mutable and cannot be hashed” error
- Python pandas / matplotlib annotating labels above bar chart columns [duplicate]
- How to upsert pandas DataFrame to PostgreSQL table?
- pandas: combine two columns in a DataFrame
- How to plot multiple dataframes to the same plot axes
- python pandas read_csv delimiter in column data
- Pandas Plotting Display all date values on x-axis (matplolib only displays few values) formatted as MMM-YYYY [duplicate]
- Week of a month pandas
- Numpy isnan() fails on an array of floats (from pandas dataframe apply)
- Add a sequence number to each element in a group using python
- Can you format pandas integers for display, like `pd.options.display.float_format` for floats?
- computing the mean for python datetime
- Pandas explode multiple columns [duplicate]